i have a script that works,just that after the round is finished,i want that all the players will got killed,for this script to work proprely,how i do that?
if #plrs == 1 then -- Last person standing -- Status.Value = " The winner is: "..plrs[1].Name plrs[1].leaderstats.Bucks.Value = plrs[1].leaderstats.Bucks.Value + reward break elseif #plrs == 0 then Status.Value = "No one won" break elseif i == 0 then Status.Value = "Time is up!" break end
you can put this code snippet where you need to kill them all
for _,v in pairs(game.Players:GetChildren()) do -- loops through all players if v.Character and v.Character:FindFirstChild("Humanoid") then -- checks if the player has a character and the character has a humanoid v.Character.Humanoid.Health = 0 -- set their health to 0 end end
for i, v in pairs (game:GetService("Players"):GetPlayers()) do v.Character:FindFirstChild("Humanoid").Health = 0 end