Basically I made a chatted event, went here to try and figure out how to fix it. Then some people helped, but I want to make it that when you say /tower (the command for the chatted event) the cooldown only affects to them (which is 5 seconds) and that someone else can still use the command when the cooldown is in effect for someone.
(the code is correct, i just want a change so that the text above can be implemented)
code:
local tpmessage = "/tower"
local endpart = game.Workspace.endPart
local debounce = false
endpart.CanCollide = false
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:Connect(function(msg)
if string.lower(msg) == tpmessage and debounce == false then
player.Character.HumanoidRootPart.CFrame = endpart.CFrame
debounce = true
wait(5)
debounce = false
end
end)
end)
Edit: I have to move out of my house for days, dont ask why, but responding will still help, and i will look at it in 2 days.