Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Could you help with Event:FireAllClients?

Asked by 10 months 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 — 10mo
0
Once I die it says "NiroTurtle is dead" once. NiroTurtle 83 — 10mo
0
first of all in the normal script why is it v.Team.Name not v.Team.Value ??????? HappyTimIsHim 637 — 10mo
0
Ah, I see.. I'll change that. NiroTurtle 83 — 10mo
0
Try :FireClient() instead. LennyPlayzYT 269 — 10mo

Answer this question