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: 1 Button Door

Previous Thread :: Next Thread 
nhanbin03 is not online. nhanbin03
Joined: 10 May 2016
Total Posts: 16
30 Sep 2016 09:46 PM
How can I open and close door with only one button?
Report Abuse
FlamingGamez is not online. FlamingGamez
Joined: 22 Jan 2015
Total Posts: 354
30 Sep 2016 10:29 PM
add a bool value into the script and name it Open

function Click()
if script.Open = false then
--script
script.Open.Value == true

else

script.Open.Value == false
end
end
script.Parent.ClickDetector.MouseClick:connect(Click)

Just athought?
Report Abuse
joshiscool22222 is not online. joshiscool22222
Joined: 27 May 2010
Total Posts: 29029
30 Sep 2016 10:30 PM
first step, rename your button in the workspace to "button" and also rename the door you want to "door" you must also insert the script into this one as well.
second step, right click on the "button" and hit Insert Object. Use the ClickDetector object.

just as a side note, you must adjust the locations accordingly meaning if you have them in a model you must address them differently.

button = script.Parent
door = game.Workspace.door

function onClicked(button)
if door.CanCollide == true then
door.CanCollide = false
door.Transparency = 0 else
door.Transparency = 1
door.CanCollide = true
end
end

script.Parent.ClickDetector.mouseClick:connect(onClicked)


Report Abuse
joshiscool22222 is not online. joshiscool22222
Joined: 27 May 2010
Total Posts: 29029
30 Sep 2016 10:37 PM
oops, switch the 0 and the 1 around btw, my mistake.


Report Abuse
nhanbin03 is not online. nhanbin03
Joined: 10 May 2016
Total Posts: 16
01 Oct 2016 12:30 AM
OMG thank you very much!!!!

That helps me a lot XD
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