So im trying to make a part that makes it transparency 1 when touched and then the transparency will go back to 0 after 3 seconds but if i touch it again then the function will fire again and here is my script:
local TransparencyPart = script.Parent
TransparencyPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then TransparencyPart.Transparency = 1 wait(3) TransparencyPart.Transparency = 0 end end)
I have no clue what you did wrong this code works for me:
local TransparencyPart = script.Parent TransparencyPart.Touched:Connect(function(hit) if hit.Parent:FindFirstChild("Humanoid") then TransparencyPart.Transparency = 1 wait(3) TransparencyPart.Transparency = 0 end end)
Good luck!