Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to kill all after the round ends?

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

2 answers

✓ Accepted answer

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

2 comments

0

doesent work..

0

is because im too NOOB

for i, v in pairs (game:GetService("Players"):GetPlayers()) do v.Character:FindFirstChild("Humanoid").Health = 0 end

This discussion is preserved as it was. New answers, comments, and votes are closed.