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

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)
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