of     1   

Wulfx
#139363631Saturday, July 05, 2014 11:39 PM GMT

function onTouched(hit) game.Workspace.SCARE.Transparency = 1 wait (0.5) game.Workspace.Scare.Transparency = 0 end script.Parent.Touched:connect(onTouched) its supposed to make it so when you touch this block, it makes the other block go invisible, but then after a few seconds it goes back to being visible. Can someone fix it? Also, i'd like it if you could tell me how to make it so the block removes itself after it finishes it's task.
Wulfx
#139363828Saturday, July 05, 2014 11:42 PM GMT

fixxed it. nevermind.
michaelh0042
#139364028Saturday, July 05, 2014 11:44 PM GMT

function onTouch(Scare) Workspace.Scare.Transparency=1 wait(1) Workspace.Scare.Transparency=0 end Workspace.Scare.Touched:connect(onTouch)
michaelh0042
#139364305Saturday, July 05, 2014 11:47 PM GMT

I suggest using references to save you time. Its a good habit to get into for making bigger scripts. So instead of being function onTouch(Scare) Workspace.Scare.Transparency=1 wait(1) Workspace.Scare.Transparency=0 end Workspace.Scare.Touched:connect(onTouch) it would be local Boo = Workspace.Scare function onTouch(Scare) Boo.Transparency=1 wait(1) Boo.Transparency=0 Boo.Touched:connect(onTouch)
Wulfx
#139364581Saturday, July 05, 2014 11:50 PM GMT

thanks, i noticed the mistake i had in it, but how can i get the block to delete itself after a few seconds after being touched, i only want the block to do this event once rather than every time you step on it
michaelh0042
#139369622Sunday, July 06, 2014 12:44 AM GMT

Do you want it to be permanently deleted from the game? Do you want it to be permanently invisible? ETC.
blox6137
#139374228Sunday, July 06, 2014 1:34 AM GMT

I would recommend making functions like this. -- game.Workspace.SCARE.Touched:connect(function(hit) game.Workspace.SCARE.Transparency = 1 wait(.5) game.Workspace.SCARE.Transparency = 0 end) -- and also to do this: SCARE = game.Workspace.SCARE, so every time you want to get game.Workspace.SCARE, all you have to enter is the word 'SCARE'. Also, you dont have to do 'game.Workspace'etc. All you have to do is "Workspace.Scare" etc. System32? Delete it.
blox6137
#139374708Sunday, July 06, 2014 1:40 AM GMT

I recommend learning how to Debounce. Debounce works effectively with the script I re-wrote for you. Let me implement Debounce into my script for you... Actually, I will just make a whole script. -- local SCARE = game.Workspace.SCARE SCARE.Touched:connect(function() SCARE.Transparency = 1 wait(.5) SCARE = nil end) -- this should delete the 'SCARE' after .5 seconds. If you want it to be able to be re-used after, I would recommend using this script: -- local SCARE = game.Workspace.SCARE debounce = false SCARE.Touched:connect(function() if debounce then return end debounce = true SCARE.Transparency = 1 SCARE.CanCollide = true wait(.5) SCARE.Transparency = 0 SCARE.CanCollide = false debounce = false end) -- System32? Delete it.

    of     1