Im trying to make something with Touched event like this;
Player will touch the part and wait 5 seconds without stopping touching the part, and then other part's transparency would be 1.
I mean if player touched the part and wait 3 seconds then stops touching it, function will not be triggered, but if he waits 5 seconds it will trigger the function. Can somebody explain how can i do this?
local part = game.Workspace.part -- your part you want local i = 0 local f = true part.Touched:Connect(function() f = true while f = true do i = i + 1 if i = 5 then -- there's script when you make player transparent end wait(1) end end) part.TouchEnded:Connect(function() f = false i = 0 end)