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)