I am making a story game, and I am wondering how to make this. The player has to touch the part in a certain time limit, and if they don't, the script will kill them.
local time = tick() script.Parent.Touched:Connect(function() local touchedTIme = tick() if not touchedTime - time <= 30 then -- In seconds to see if the part was touched print("Part was touched in 30 seconds.") else print("Part wasn't touched in time.") end end)
This should work.
~Dan_PanMan, advanced scripter.