Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Is this script correct?

Asked by 11 years ago
1H = game.Workspace.Part
2 
3function OnTouch(Part)
4wait(2)
5H.Transparency = 1
6wait(2)
7H.Transparency = 0
8end
  • I'm a newbie, I'm trying to experiment with functions.

2 answers

Log in to vote
1
Answered by 11 years ago
1H = game.Workspace.Part
2function onTouch(thing)--Thing is the thing that touched this part
3wait(2)
4H.Transparency = 1
5wait(2)
6H.Transparency = 0 -- Changing the transparency of H, which is the part in workspace.
7end
8script.Parent.Touched:connect(onTouch)--The most important part, the closing of the function. This calls the function when the script's parent is touched. Make sure that this script is inside of the object you want to be touched.
0
Thank you DeathBear :D bloonblaster2000 55 — 11y
Ad
Log in to vote
-1
Answered by 11 years ago
1game.Workspace.Part
2 
3function OnTouch(Part)
4wait(2)
5game.Workspace.Part.Transparency = 1
6wait(2)
7game.Workspace.Part.Transparency = 0
8end
0
All you did was take out H = ._. bloonblaster2000 55 — 11y

Answer this question