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

I need Help, To make the Gui appear to all Players at the same time?

Asked by
KenUSM 53
6 years ago

I keep having this problem, I think I'm using the for i, v in pairs() loop wrong for some reason. But every time the second Player has to wait to for the first player to close his Gui so it could appear for the second player. the script so far.

function SelectMap()
    if RoundStart.Value == false then 
        for i,v in pairs(game.Players:GetChildren()) do
            v.PlayerGui.GameGui.MapVote.Visible = true
            for i = 15,0,-1 do 
                Status.Value = i
                wait(1)
            end
            v.PlayerGui.GameGui.MapVote.Visible = false
            MapSelected = true
        end
    end
end

1 answer

Log in to vote
0
Answered by
Pejorem 164
6 years ago
local function SelectMap()
    if RoundStart.Value == false then
        for i, v in pairs(game.Players:GetChildren()) do
            spawn(function()
                v.PlayerGui.GameGui.MapVote.Visible = true
                for j = 15, 0, -1 do
                    Status.Value = j
                    wait(1)
                end
                v.PlayerGui.GameGui.MapVote.Visible = false
                MapSelected = true --erm.... so this gets set a lot of times?!?!?!?!?!?!
            end)
        end
    end
end

can't be bothered to explain because this isn't even FilteringEnabled

0
This isn't the whole script, MapSelected Detects the function was called, if MapSelected isn't true then it will call the function again. It's also a loop, KenUSM 53 — 6y
0
Yeah but it's setting the value of MapSelected the same amount of times as there are players lol Pejorem 164 — 6y
Ad

Answer this question