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: Dissapearing Brick Script Error

Previous Thread :: Next Thread 
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 12:16 AM
In my script, I am trying to make a block, once stepped on, start disappearing, and then become invisible and able to go through, and then after a few seconds, come back to how it was originally. This is working just fine, until it's supposed to return to normal. It doesn't return until it is stepped on again. Here is my script:

p = script.Parent

p.Touched:connect(function(onTouch)
wait(3)
p.Transparency = .5
wait(.5)
p.Transparency = 1
p.CanCollide = false
wait(3)
p.Transparency = 0
p.CanCollide = true
end)
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
05 Jul 2014 12:17 AM
Try adding a debounce,
http://wiki.roblox.com/index.php?title=Debounce
Report Abuse
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 12:23 AM
I did, and it gave the same output. Here's my new code:

p = script.Parent

local brickTouched = false

p.Touched:connect(function(onTouch)
if not brickTouched then
brickTouched = true
wait(3)
p.Transparency = .5
wait(.5)
p.Transparency = 1
p.CanCollide = false
wait(3)
p.Transparency = 0
p.CanCollide = true
brickTouched = false
end
end)
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
05 Jul 2014 12:50 AM
Did you wait a few seconds for it to reappear?.
Report Abuse
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 12:54 AM
Yes
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
05 Jul 2014 12:56 AM
Try anchoring the brick and inform me of the result.
Report Abuse
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 12:57 AM
It was anchored originally. Un-anchoring it gives the same result.
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
05 Jul 2014 01:00 AM
Try removing the first wait().
Report Abuse
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 01:02 AM
Oh my gosh I am such an idiot. I was editing the wrong script. The debounce method ended up working, and sorry for leading you on.
Report Abuse
ecolon is not online. ecolon
Joined: 10 Aug 2010
Total Posts: 182
05 Jul 2014 01:04 AM
Thank you for your help!
Report Abuse
AnonyAnonymous is not online. AnonyAnonymous
Joined: 23 Jun 2013
Total Posts: 6332
05 Jul 2014 01:06 AM
It's no problem, good to see that you resolved it.
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