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 » Scripting Helpers
Home Search
 

Re: Disappear/Appear Script

Previous Thread :: Next Thread 
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
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
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 05:02 PM
Thanks, I'll try it.
Report Abuse
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
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 is not online. 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 is not online. 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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 06:31 PM
B1, I need a script for a button, not a click door.
Report Abuse
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
26 Oct 2013 06:33 PM
@OP
KEVEKEV77 provided you with one.

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
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 is not online. Hacted
Joined: 16 Sep 2010
Total Posts: 9496
26 Oct 2013 06:45 PM
wow bat
fancy seeing you here
Report Abuse
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 06:47 PM
I guess, need it for my training facility.
B2
Report Abuse
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 06:50 PM
I'll try it when I get home, thanks.
Report Abuse
cntkillme is not online. 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
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
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 is not online. 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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 06:58 PM
Which one do I use, cnt's or Billy's? ❔
Report Abuse
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
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
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
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 is not online. 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
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 07:05 PM
Ok.
Report Abuse
MeBilly8440 is not online. MeBilly8440
Joined: 27 Jul 2009
Total Posts: 2783
26 Oct 2013 07:05 PM
Hmmm... true, true.

Use mine :D

Wiki Profile: http://wiki.roblox.com/index.php/User:Nelson
Report Abuse
batpenguin24 is not online. batpenguin24
Joined: 20 May 2012
Total Posts: 2650
26 Oct 2013 07:07 PM
Lol ok, I'll use yours.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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