Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

2 comments

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,

0

Yeah but it's setting the value of MapSelected the same amount of times as there are players lol

This discussion is preserved as it was. New answers, comments, and votes are closed.