|
| 09 Jul 2015 12:23 AM |
so im trying to make it when this part is touched the value changes to 1, and when you stop touching it turns back to 0, but the value never goes to 1
workspace.Key2.ClickDetector.MouseClick:connect(function() game.Players.LocalPlayer.Backpack.Keys.Value = 2 workspace.Key2.Sound:Play() workspace.Key2:Destroy() script.Parent.Visible = true script.Parent.Text = "This must be the key he said would lead out of here." for i= 1,10 do wait() script.Parent.TextTransparency = 1-(i*0.1) end wait(1) for i= 1,10 do wait() script.Parent.TextTransparency = (i*0.1) end wait(.1) workspace.Sounds.Effect1:play() workspace.Sounds.footsteps:play() script.Parent.Parent.Emergency.Text = "HIDE!" script.Parent.Parent.Emergency.Visible = true script.Parent.Parent.Timer.Visible = true for i=10,0,-1 do wait(1) script.Parent.Parent.Timer.Text = i end script.Parent.Parent.Timer.Visible = false script.Parent.Parent.Emergency.Visible = false for i,Lights in pairs (workspace.TurnOffTorches:GetChildren()) do local Emitter = Lights:FindFirstChild("ParticleEmitter") local Light = Lights:FindFirstChild("PointLight") Emitter.Enabled = false Light.Enabled = false end workspace.HidingPlace1.Touched:connect(function() game.Players.LocalPlayer.Backpack.HidingPlace.Value = 1 end) workspace.HidingPlace1.TouchEnded:connect(function() game.Players.LocalPlayer.Backpack.HidingPlace.Value = 0 end) if game.Players.LocalPlayer.Backpack.HidingPlace.Value == 1 then workspace.Sounds.MonsterGrowl:Play() end wait(6) for i,Lights in pairs (workspace.TurnOffTorches:GetChildren()) do Lights.ParticleEmitter.Enabled = true Lights.PointLight.Enabled = true end end)
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 12:24 AM |
its down close to the bottom btw
<3 cats <3 |
|
|
| Report Abuse |
|
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
| |
|
|
| 09 Jul 2015 12:27 AM |
how would that help here?
<3 cats <3 |
|
|
| Report Abuse |
|
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
|
| 09 Jul 2015 12:29 AM |
player.Character.Torso.Changed if torsoposition-hidingplaceposition.magnitude<5 then value=1 else value=o |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 12:31 AM |
wouldnt that interfere with me using the value in the future with a different part?
<3 cats <3 |
|
|
| Report Abuse |
|
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
|
| 09 Jul 2015 12:33 AM |
or you could put the script in each part idk easier
but tbh touched event glitches a lot when the par is set to CanCollide true, and even sometimes CanCollide false |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 12:59 AM |
now its throwing me the error that it expected ) to close at column 54 but got ,
if game.Players.LocalPlayer.Character.Torso.Position-(56.6, -5.7, 96.4).magnitude<5 then
<3 cats <3 |
|
|
| Report Abuse |
|
|
| |
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
|
| 09 Jul 2015 01:01 AM |
| make it if (blalalal-blalala).magnitude, not blalala-(blalala).magnitude |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 01:02 AM |
still gives the same error
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 01:09 AM |
it wants a ) somewhere, but idk where
<3 cats <3 |
|
|
| Report Abuse |
|
|
KoreanBBQ
|
  |
| Joined: 06 Mar 2015 |
| Total Posts: 1436 |
|
|
| 09 Jul 2015 01:11 AM |
| look at ends when that happens |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jul 2015 01:21 AM |
would this work as well? (game.Players.LocalPlayer.Character.Torso.Position-workspace.HidingPlace1.Position)
<3 cats <3 |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2015 01:34 AM |
got it fixed, thanks
<3 cats <3 |
|
|
| Report Abuse |
|
|