Could you help with Event:FireAllClients?
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
02 | local plrs = game.Players:GetChildren() |
03 | local chill = script.chill.Value |
06 | for _,v in pairs (game.Players:GetChildren()) do |
07 | if v.Team.Name = = "Survivors" and chill = = false then |
08 | local char = v.Character |
10 | if char.Humanoid.Health < = 0 then |
11 | print (v.Name.. " is dead" ) |
13 | game.ReplicatedStorage.ESallyhasWon:FireAllClients() |
15 | print (v.Name.. " is not dead" ) |
Local Script
1 | game.ReplicatedStorage.ESallyhasWon.OnClientEvent:Connect( function () |
2 | for _, v in pairs (game.Players:GetChildren()) do |
3 | if v.Team.Name = = "Earthworm Sally" then |
4 | local userID = v.UserId |
5 | script.Parent.Parent.Visible = true |