I have a question, how can you disconnect and connect a function back again? I’m currently trying but it appears there is an error. I want it so if a player touches a part it fires a remote event, disconnect it then, lastly connect it back in 4 seconds so everything works again.
local event
event = script.Parent.Touched:Connect(function(hit)
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
script.Parent.RemoteEvent:FireAllClients(hit.Parent.Name)
event:Disconnect()
end
wait(4)
event = script.Parent.Touched:Connect(hit)
end)