-- NinjoOnline --
map = game.ServerStorage.Maps:GetChildren()
while true do
--------------------------
-- Random map is chosen --
--------------------------
if game.Players.NumPlayers > 1 then
game.StarterGui.Main.Header.MainText.Text = "Deciding what map to play"
wait(3)
game.StarterGui.Main.Header.MainText.Text = ""
ranMap = math.random(1, #map)
mapChosen = map[ranMap]
game.StarterGui.Main.Header.MainText.Text = "Map Chosen: " .. mapChosen.Name
wait(2)
game.StarterGui.Main.Header.MainText.Text = ""
mapChosenClone = mapChosen:Clone()
mapChosenClone.Parent = game.Workspace.MapHolder
wait(2)
------------------------
-- Picks random teams --
------------------------
players = game.Players:GetChildren()
teams = {"Bright red","Bright blue"}
num = 1
for i,v in pairs(players) do
v.TeamColor = BrickColor.new(teams[num])
num = num + 1
if num > #teams then
num = 1
end
end
---------------------------------
-- Teleport players to the map --
---------------------------------
bspawn = mapChosenClone.BlueSpawn
rspawn = mapChosenClone.RedSpawn
for i,v in pairs(game.Players:GetPlayers()) do
name = v.Name
check = game.Workspace:FindFirstChild(name)
if v.TeamColor == BrickColor.new("Bright red") then
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
local distance = math.random(-4, 4);
check:MoveTo(rspawn.Position + Vector3.new(distance, distance, distance))
end
end
elseif v.TeamColor == BrickColor.new("Bright blue") then
if check then
checkHumanoid = check:FindFirstChild("Humanoid")
if checkHumanoid then
local distance = math.random(-4, 4);
check:MoveTo(bspawn.Position + Vector3.new(distance, distance, distance))
end
end
end
end
---------------------------
-- Round begins countdown --
---------------------------
for i = 3, 1, -1 do
game.StarterGui.Main.Header.MainText.Text = "Game begins in: " .. i
wait(1)
game.StarterGui.Main.Header.MainText.Text = ""
end
-------------------------------
-- Countdown till round ends --
-------------------------------
for i = 30, 1, -1 do
game.StarterGui.Main.Header.MainText.Text = "Time left: " .. i
wait(1)
game.StarterGui.Main.Header.MainText.Text = ""
end
game.StarterGui.Main.Header.MainText.Text = "The round has ended"
wait(1)
game.StarterGui.Main.Header.MainText.Text = ""
------------------------------------
-- Teleport players back to lobby --
------------------------------------
for i,v in pairs(game.Players:GetPlayers()) do
v.Character:MoveTo(Vector3.new(108, 11.19, -29))
end
wait(1)
---------------------
-- Destroy the map --
---------------------
mapChosenClone:Destroy()
--------------------------------------------------
-- Needs to be 1 more player for round to begin --
--------------------------------------------------
else
game.StarterGui.Main.Header.MainText.Text = "You need 1 more player to join"
end
wait(1)
end
Ok so, this script pretty much tell the player that if their is more than 1 player on, then pick a random map. That works, but, the GUI that displays the text wont update. I started a server with 2 players, for P1 it says "You need 1 more player" and for P2 it says "Deciding what map to play". But on the server it changes and is working properly. Is something wrong, or do i need to start a real server and get a friend to play. Anyone help?

7 comments
No this may or may not work. I have 1 main script. The main script chooses map, tps everyone, and all that. I need it so it will go in one script and not be a local.
and what is a server script?
I have just updated the script to the full script.
I have added an updated section to the end of the post. It should work now. If it doesn't, it must be something that you have done.
still dosent work
It can't be me. This is the only script. It has always worked, choosing map, etc. Just the text. It is defiantly main.Header.MainText, etc. It just dosent update at all
Are you sure you're not accessing the gui wrong or something? Open the game in play solo in studio and tell me what the output says.