Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Could you help with Event:FireAllClients?

Asked by
niroqeo 123
5 years ago

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

01wait(5)
02local plrs = game.Players:GetChildren()
03local chill = script.chill.Value
04while true do
05    wait(.1)
06for _,v in pairs(game.Players:GetChildren()) do
07if v.Team.Name == "Survivors" and chill == false then
08    local char = v.Character
09    if char ~= nil then
10        if char.Humanoid.Health <=0 then
11            print(v.Name.." is dead")
12            chill = true
13            game.ReplicatedStorage.ESallyhasWon:FireAllClients()
14        else
15            print(v.Name.." is not dead")
16        end
17    end
18end
19end
20end

Local Script

1game.ReplicatedStorage.ESallyhasWon.OnClientEvent:Connect(function()
2for _, 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
6        script.Parent.Image = "https://web.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&userid="..userID
7    end
8end
9end)
0
it would be helpful if you told us what your script printed SoftlockedUnderZero 668 — 5y
0
Once I die it says "NiroTurtle is dead" once. niroqeo 123 — 5y
0
first of all in the normal script why is it v.Team.Name not v.Team.Value ??????? HappyTimIsHim 652 — 5y
0
Ah, I see.. I'll change that. niroqeo 123 — 5y
0
Try :FireClient() instead. LennyPlayzYT 269 — 5y

Answer this question