Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is this script correct?

H = game.Workspace.Part

function OnTouch(Part)
wait(2)
H.Transparency = 1
wait(2)
H.Transparency = 0
end
  • I'm a newbie, I'm trying to experiment with functions.

2 answers

✓ Accepted answer
H = game.Workspace.Part
function onTouch(thing)--Thing is the thing that touched this part
wait(2)
H.Transparency = 1
wait(2)
H.Transparency = 0 -- Changing the transparency of H, which is the part in workspace.
end
script.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.

1 comment

0

Thank you DeathBear :D

game.Workspace.Part

function OnTouch(Part)
wait(2)
game.Workspace.Part.Transparency = 1
wait(2)
game.Workspace.Part.Transparency = 0
end

1 comment

0

All you did was take out H = ._.

This discussion is preserved as it was. New answers, comments, and votes are closed.