of     1   

SpiderStew
#188447805Monday, May 02, 2016 3:13 AM GMT

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
Rallient
#188449252Monday, May 02, 2016 3:44 AM GMT

Try using something like for i = 180, 0, -1 do Instead of repeat, you could also use the while true do loop instead of repeat. Idk, but I'm new to Lua xD.

    of     1