So; the issue with this script I am doing is that it detects a firing event across all clients. That would result in multiple maps spawning which I do not want to have happening. Do you guys know of any way I can get all the GUIs and update them from somewhere else?
Here’s the script.
local deb = true
local v = #game.Players:GetPlayers()
local inter = false
local gamE = true
-- 30 seconds for intermission and 90 for map exist
while wait(1) do
if v < 2 then
--wait for players
script.Parent.Text = "Waiting for players..."
elseif v >= 2 and (deb == true) and (inter == false) then
game.ReplicatedStorage.MapChange:FireServer()
inter = true
deb = false
repeat
script.Parent.Text = "Intermission:"..script.Value.Value
script.Value.Value = script.Value.Value -1
wait(1)
until
script.Value.Value == 0 and inter == true
wait()
inter = false
gamE = true
-- choosing the map/ gametime
script.Parent.Text = "Choosing map.."
wait(4)
script.Value.Value = 90
repeat
script.Parent.Text = "Game time:"..script.Value.Value
script.Value.Value = script.Value.Value -1
until
script.Value.Value == 0 and gamE == true
wait()
gamE = false
deb = true
-- end of script
end
end
Sorry about the spaghetti code; I’ve added some notes to help distinguish parts.