|
| 26 Oct 2013 04:59 PM |
Can someone give me a script that makes something disappear and reappear (kind of like a door), so I can put in a button, please?
|
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 05:01 PM |
local door = game.Workspace.Door -- Where the door is script.Parent.MouseButton1Click:connect(function() -- Assuming the script is inside of a GuiButton door.Transparency = 1 -- Make it invisible door.CanCollide = false -- Make it so you can walk through it wait(3) door.Transparency = 0 -- Make it visible door.CanCollide = true -- Make it so you cannot walk through it end)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Oct 2013 05:08 PM |
| I meant a script where you press a button once, then it disappears until you click it again. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 26 Oct 2013 05:08 PM |
local door = game.Workspace.Door -- Where the door is script.Parent.ClickDetector.MouseClick:connect(function() --Assuming you have a ClickDetector. door.Transparency = 1 door.CanCollide = false wait(5) door.Transparency = 0 door.CanCollide = true end) -- May not work, if it doesent post again, cause i know why. |
|
|
| Report Abuse |
|
|
KEVEKEV77
|
  |
| Joined: 12 Mar 2009 |
| Total Posts: 6961 |
|
|
| 26 Oct 2013 05:10 PM |
| Oh, well you click the door then it does that stuff. Not a button. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:31 PM |
| B1, I need a script for a button, not a click door. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:33 PM |
@OP KEVEKEV77 provided you with one.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:36 PM |
| He said it's a script for a click door, yet I need a script for a button. |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:39 PM |
| And I mean just one button, click it once it disappears, click it again it reappears. |
|
|
| Report Abuse |
|
|
Hacted
|
  |
| Joined: 16 Sep 2010 |
| Total Posts: 9496 |
|
|
| 26 Oct 2013 06:45 PM |
wow bat fancy seeing you here |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:47 PM |
I guess, need it for my training facility. B2 |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:49 PM |
Put a ClickDetector in the button, and do this:
local door = game.Workspace.Door -- The door local button = game.Workspace.Button -- The button
button.ClickDetector.MouseClick:connect(function() door.Transparency = door.Transparency == 1 and 0 or 1 door.CanCollide = not door.CanCollide end)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:50 PM |
| I'll try it when I get home, thanks. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Oct 2013 06:51 PM |
Or, for the fun of it: door.Transparency = math.abs(door.Transparency - 1) |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:52 PM |
Ooooo fancy c: (And a lot easier to write than mine... I think I'll be sticking to that from now on)
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Oct 2013 06:53 PM |
Which do you think is even the slightest faster? It would probably be range by like, 1/1000 of a millisecond |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 06:58 PM |
| Which one do I use, cnt's or Billy's? ❔ |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 07:02 PM |
Yours was faster than mine by 1.4305114746094e-005 of a second. Or, in other words, yours was faster than mine by approximately 6/625ths of a second.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
|
| 26 Oct 2013 07:03 PM |
In other words, use cnts, because it's faster to write, and it executes faster.
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 26 Oct 2013 07:03 PM |
But yours is fail safe.
If the number becomes like 0.1, yours will make it to 0 and 1, mine would make it to 1.1 and 0.1 |
|
|
| Report Abuse |
|
|
| |
|
|
| 26 Oct 2013 07:05 PM |
Hmmm... true, true.
Use mine :D
Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson |
|
|
| Report Abuse |
|
|
| |
|