I am trying to make this script kick the players once the timer reaches 0, however I have had no luck in trying to get this to work so far this is the code I have
timer = game.ReplicatedStorage:WaitForChild("Timer")
timer.Value = 5
while true do
if timer.Value >= 1 then
timer.Value = timer.Value - 1
wait(1)
else return nil
end
end
-- everyone below not working
function update()
local p = game.Players:GetPlayers()
if timer.Value == 0 then
for i = 1, #p do
p[i]:Kick()
end
end
end
while wait(.33) do
update()
end
Also should I be using a remote function/event when kicking clients?
