Hello all, I need help on a countdown script. The point of the script is to kill the player when the countdown reaches zero but every time it reaches zero, it either doesn't do anything or it says Player is not a valid member of workspace. Heres my code :D
kill = script.Parent
x = 15;
repeat
print(x)
wait(1)
x = x - 1
until x == 0
if x == 0 then
if kill:FindFirstChild("Player") then
kill.Player:FindFirstChild("Humanoid")
if kill.Player:FindFirstChild("Humanoid") then
kill.Player.Humanoid.Health = 0
end
end
end |