i learned how to make a script for a brick to kill you... but i’m having trouble to make it where if someone dies then everyone dies and respawns, so how do i do it or how do i start off? any help is appreciated!
COMMUNITY QUESTION
scripting trouble: script where if someone dies then everyone dies?
2 answers
I would advise you look into the Player.CharacterAdded event, the Humanoid.Died event, and the Players.PlayerAdded event. You can use these to help detect when someone has died.
**Put a local script into StarterGui: **
wait()
local player = game.Players.LocalPlayer
local chr = player.Character
local humanoid = chr:WaitForChild("Humanoid")
humanoid.Died:Connect(function()
for i,v in pairs(game.Players:GetPlayers()) do
v.Character:WaitForChild("Humanoid").Health = 0
end
end)
Hope this helps!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
it sadly didn't work :( i appreciate it though, i'll have to find out some way.
Did you put a local script into the starter gui?