generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: why isnt this value updating?

Previous Thread :: Next Thread 
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 12:24 AM
its down close to the bottom btw


<3 cats <3
Report Abuse
KoreanBBQ is not online. KoreanBBQ
Joined: 06 Mar 2015
Total Posts: 1436
09 Jul 2015 12:26 AM
#magnitude
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 12:27 AM
how would that help here?


<3 cats <3
Report Abuse
KoreanBBQ is not online. 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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
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 is not online. 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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 12:59 AM
to close (*


<3 cats <3
Report Abuse
KoreanBBQ is not online. 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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 01:02 AM
still gives the same error


<3 cats <3
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 01:09 AM
it wants a ) somewhere, but idk where


<3 cats <3
Report Abuse
KoreanBBQ is not online. KoreanBBQ
Joined: 06 Mar 2015
Total Posts: 1436
09 Jul 2015 01:11 AM
look at ends when that happens
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 01:12 AM
didnt work


<3 cats <3
Report Abuse
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
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
bubbaman73 is not online. bubbaman73
Joined: 02 Feb 2013
Total Posts: 795
09 Jul 2015 01:34 AM
got it fixed, thanks


<3 cats <3
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image