So I have a script that when everyone on a certain team dies, the script loads everyone's character. I decided to make it so when they all die, a GUI pops up saying that the bad dude won. But the GUI doesn't pop up, and there's no error message. Could you please see what's wrong with the script? Any help is appreciated! Server Script

wait(5)
local plrs = game.Players:GetChildren()
local chill = script.chill.Value
while true do
	wait(.1)
for _,v in pairs(game.Players:GetChildren()) do
if v.Team.Name == "Survivors" and chill == false then
	local char = v.Character
	if char ~= nil then
		if char.Humanoid.Health <=0 then
			print(v.Name.." is dead")
            chill = true
			game.ReplicatedStorage.ESallyhasWon:FireAllClients()
		else
			print(v.Name.." is not dead")
		end
	end
end
end
end

Local Script

game.ReplicatedStorage.ESallyhasWon.OnClientEvent:Connect(function()
for _, v in pairs(game.Players:GetChildren()) do
	if v.Team.Name == "Earthworm Sally" then
		local userID = v.UserId
		script.Parent.Parent.Visible = true
		script.Parent.Image = "https://web.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userid="..userID
	end
end
end)

5 comments

0

it would be helpful if you told us what your script printed

0

Once I die it says "NiroTurtle is dead" once.

0

first of all in the normal script why is it v.Team.Name not v.Team.Value ???????

0

Ah, I see.. I'll change that.

0

Try :FireClient() instead.