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: Code is not working

Previous Thread :: Next Thread 
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 02:33 PM
When i press the button the stairs go up and sets the value to true. But when i press it again it doesnt go down? Why?


Stair1 = script.Parent.Parent.Stair1 --All the variables
Stair2 = script.Parent.Parent.Stair2
Stair3 = script.Parent.Parent.Stair3
Stair4 = script.Parent.Parent.Stair4
Stair5 = script.Parent.Parent.Stair5
Stair6 = script.Parent.Parent.Stair6
Stair7 = script.Parent.Parent.Stair7
Stair8 = script.Parent.Parent.Stair8
Support1 = script.Parent.Parent.Support1
Support2 = script.Parent.Parent.Support2
Support3 = script.Parent.Parent.Support3
Support4 = script.Parent.Parent.Support4
Support5 = script.Parent.Parent.Support5
Support6 = script.Parent.Parent.Support6
Support7 = script.Parent.Parent.Support7
Support8 = script.Parent.Parent.Support8


value = script.Parent.Value
var = 0
local debounce = false
function onClicked(playerWhoClicked) --Checks if button is clicked
if not debounce then
if value.Value == false then --Is the value == false?
debounce = true
for i=1,80 do --Does the first Stair
Stair1.CFrame = Stair1.CFrame + Vector3.new(0,0.1,0)
Support1.CFrame = Support1.CFrame + Vector3.new(0,0.1,0)
Stair2.CFrame = Stair2.CFrame + Vector3.new(0,0.1,0)
Support2.CFrame = Support2.CFrame + Vector3.new(0,0.1,0)
Stair3.CFrame = Stair3.CFrame + Vector3.new(0,0.1,0)
Support3.CFrame = Support3.CFrame + Vector3.new(0,0.1,0)
Stair4.CFrame = Stair4.CFrame + Vector3.new(0,0.1,0)
Support4.CFrame = Support4.CFrame + Vector3.new(0,0.1,0)
Stair5.CFrame = Stair5.CFrame + Vector3.new(0,0.1,0)
Support5.CFrame = Support5.CFrame + Vector3.new(0,0.1,0)
Stair6.CFrame = Stair6.CFrame + Vector3.new(0,0.1,0)
Support6.CFrame = Support6.CFrame + Vector3.new(0,0.1,0)
Stair7.CFrame = Stair7.CFrame + Vector3.new(0,0.1,0)
Support7.CFrame = Support7.CFrame + Vector3.new(0,0.1,0)
Stair8.CFrame = Stair8.CFrame + Vector3.new(0,0.1,0)
Support8.CFrame = Support8.CFrame + Vector3.new(0,0.1,0)
wait(0.1)
end
value.Value = true
debounce = false
print("done")
end
else if value.Value == true then --Is the value == true?
debounce = true
for i=1,80 do --Does the first Stair
Stair1.CFrame = Stair1.CFrame + Vector3.new(0,-0.1,0)
Support1.CFrame = Support1.CFrame + Vector3.new(0,-0.1,0)
Stair2.CFrame = Stair2.CFrame + Vector3.new(0,-0.1,0)
Support2.CFrame = Support2.CFrame + Vector3.new(0,-0.1,0)
Stair3.CFrame = Stair3.CFrame + Vector3.new(0,-0.1,0)
Support3.CFrame = Support3.CFrame + Vector3.new(0,-0.1,0)
Stair4.CFrame = Stair4.CFrame + Vector3.new(0,-0.1,0)
Support4.CFrame = Support4.CFrame + Vector3.new(0,-0.1,0)
Stair5.CFrame = Stair5.CFrame + Vector3.new(0,-0.1,0)
Support5.CFrame = Support5.CFrame + Vector3.new(0,-0.1,0)
Stair6.CFrame = Stair6.CFrame + Vector3.new(0,-0.1,0)
Support6.CFrame = Support6.CFrame + Vector3.new(0,-0.1,0)
Stair7.CFrame = Stair7.CFrame + Vector3.new(0,-0.1,0)
Support7.CFrame = Support7.CFrame + Vector3.new(0,-0.1,0)
Stair8.CFrame = Stair8.CFrame + Vector3.new(0,-0.1,0)
Support8.CFrame = Support8.CFrame + Vector3.new(0,-0.1,0)
wait(0.1)
end
value.Value = false
debounce = false
end
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

#code game.Workspace.littelbigblox.Head:Remove()
Report Abuse
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 02:39 PM
b

#code game.Workspace.littelbigblox.Head:Remove()
Report Abuse
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 02:50 PM
b2

#code game.Workspace.littelbigblox.Head:Remove()
Report Abuse
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 03:01 PM
b3

#code game.Workspace.littelbigblox.Head:Remove()
Report Abuse
RymasterE is not online. RymasterE
Joined: 11 Sep 2008
Total Posts: 1418
06 Dec 2015 03:14 PM
Upload the script and the set it's supposed to manipulate as a model and I'll look into it.
Report Abuse
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 03:14 PM
b4

#code game.Workspace.littelbigblox.Head:Remove()
Report Abuse
littelbigblox is not online. littelbigblox
Joined: 29 Aug 2011
Total Posts: 1956
06 Dec 2015 03:15 PM
What do you mean?

#code game.Workspace.littelbigblox.Head:Remove()
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