Hi!
For some reason, my script here should to the following
1: Select a map out of Lighting, and then load it (tp players)
2: Change the text of the UI
Intermission = 10
PlayTime = 75
local text = game.Players.PlayerGui:FindFirstChild("MGDisplay.Frame.GameChosen")
while wait () do
wait(Intermission)
Maps = (math.random(1,3))
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
if Maps == 1 then
text.Text = "6 Blocks"
map = game.Lighting:FindFirstChild("Map2"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
wait (PlayTime)
game.Workspace.Map:remove()
end
--4Block
if Maps == 2 then
text.Text = "4 Blocks"
map = game.Lighting:FindFirstChild("Map1"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["SpawnPart"]
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
--rising lava--
if Maps == 3 then
text.Text = "Rising Lava"
map = game.Lighting:FindFirstChild("Map3"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
end
end
If this is a script than text, you would have to indicate the player instance for example local text = game.Players.Roblox.PlayerGui:FindFirstChild(“MGDisplay.Frame.GameChosen”) if this is a localscript do local text = game.Players.LocalPlayer.PlayerGui:FindFirstChild(“MGDisplay.Frame.GameChosen”)
That is not whats its doing. Also seeing that you are using a serverscript and not localscript, I would not recommend to mess with the UI using that, cause it is basically impossible to manipulate the UI of one specific player using this method.
Try to get the UI in a localscript and then do game.Players.Localplayer.PlayerGui
No, to get this path you need to do game.Players.YourPlayerNameHere.PlayerGui.
But once again, I’d not recommend UI manipulation using a serverscript.
Edit: When using a localscipt you can alternatively do game.Players.LocalPlayer.PlayerGui
if Maps == 1 then
text.Text = "6 Blocks"
map = game.Lighting:FindFirstChild("Map2"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
wait (PlayTime)
game.Workspace.Map:remove()
end
--4Block
if Maps == 2 then
text.Text = "4 Blocks"
map = game.Lighting:FindFirstChild("Map1"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["SpawnPart"]
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
--rising lava--
if Maps == 3 then
text.Text = "Rising Lava"
map = game.Lighting:FindFirstChild("Map3"):Clone()
map.Parent = game.Workspace
map.Name = "Map"
map:MakeJoints()
target = game.Workspace.Map["Spawn1"]
for i, v in pairs(game.Players:GetChildren()) do
v.Character.Torso.CFrame = target.CFrame + Vector3.new(0,4,0)
wait(2)
end
wait(PlayTime)
game.Workspace.Map:remove()
end
end
end
In your screenshot of the console it looked as if you forgot to capitalize the m of “Map1” in your script.
But in the screenshot of the script it looked perfectly fine, so did you test the script again?