I made this script inside a part, that when touched, it becomes invisible, and when not touched, it appears again.
When I touch it, it turns invisible, but it stays like that even when I'm not touching it.
script.Parent.Touched:connect(function(HIT) local H = HIT.Parent:FindFirstChild("Humanoid") if H then script.Parent.Transparency = 1 elseif not H then script.Parent.Transparency = 0 end end)
Use the TouchEnded event.
script.Parent.TouchEnded:connect(funtcion(HIT) local H = HIT.Parent:FindFirstChild("Humanoid") if H and script.Parent.Transparency == 1 then repeat wait() until H script.Parent.Transparency = 0 elseif not H then script.Parent.Transparency = 1 end end)