I can not figure out how to use the wait( ) feature. For example I am making a brick that makes you fall if you don't walk across fast enough. I wrote the script using this format
local trapdoor = workspace.trapdoor
function onTouch(part)
trapdoor.CanCollide = true
trapdoor.CanCollide = true
trapdoor.Transparency = 0
wait(.5)
trapdoor.CanCollide = false
trapdoor.Transparency = .3
wait(2)
trapdoor.CanCollide = true
trapdoor.Transparency = 0
end
trapdoor.Touched:connect(onTouch)
when i walk on the block it works but if i jump when it starts to go away the script resets rather than continuing the rest of the script. PLEASE HELP ME TIME SCRIPT TO ONLY WORK EVERY SO MANY SECONDS!!! HELP!!!~~~~~~~~~~~~~~~~~

1 comment
do i add this to the end or the start of the script and do i need to change anything before i do? besides the
if