|
| 26 Nov 2014 11:56 AM |
Just need it so there's a cool down. Won't work for me unfortunately.
local db=false script.touch.OnInvoke=function(name) name.Health=name.MaxHealth db=true wait(15) db=false
end |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2014 12:11 PM |
Wouldn't you need an if statement to check if the debounce is true?
Theoretically I would imagine it to be something like this:
local db=false script.touch.OnInvoke=function(name) if db==false then name.Health=name.MaxHealth db=true end wait(15) db=false end
This way, when the brick is touched, the script checks if db is false. If it is false, then the player's health will be restored AND db will be set to true (that way if the brick is touched again before db is set back to false after the 15 second delay, the if statement will not pass because db will be set to true).
I hope that makes sense and good luck! |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2014 12:14 PM |
| Yes it does and it worked, thank you. :) |
|
|
| Report Abuse |
|
|
|
| 26 Nov 2014 12:16 PM |
| Right on! You're welcome! Happy to help! |
|
|
| Report Abuse |
|
|