I am stuck on something in my code and I can't find whats wrong with it, if someone could tell me what is wrong with my code and how to fix it that would be greatly appreciated. Have a good day.
while true do --This makes sure it keeps going and doesn't die out on us
wait(15) --This is how long until the games are started. Recomended that you keep to 5
local m = math.random(1,1) --This randomly selects a game. The seven shows how many games there are
local Players = game:GetService("Players")
local function onPlayerAdded(player)
print("Player: " .. player.Name)
end
for _, player in pairs(Players:GetPlayers()) do
onPlayerAdded(player)
end
Players.PlayerAdded:Connect(onPlayerAdded) --This checks for players and gets them
msg = Instance.new("Message") --This make the annoying messages that appear on you screen
msg.Parent = nil --This identifies the game
if m == 1 then --don't change unless you know what you are doing
msg.Parent = game.Workspace --This makes sure it says and appears in the workspace
script.Parent.Text = "Choosing Minigame." --A bunch of messages to tell you that the game is starting which you can change if desired
wait(1)
script.Parent.Text = "Choosing Minigame.."
wait(1)
script.Parent.Text = "Choosing Minigame..."
wait(1)
script.Parent.Text = "A Minigame has been chosen!"
wait(3)
script.Parent.Text = "The Minigame is..."
wait(3)
script.Parent.Text = "Obby" --Put the name of the minigame you want it to be called
wait(2)
script.Parent.Text = "Get to the top before the water gets to the top" --Put the rules of the minigame
wait(5)
script.Parent.Text = "The game will be starting in:"
wait(1)
script.Parent.Text = "3"
wait(1)
script.Parent.Text = "2"
wait(1)
script.Parent.Text = "1"
wait(1)
script.Parent.Text = "Begin!"
wait(1)
player[i].Character:MoveTo(Vector3.new(36.548, 8447.98, -1174.169)) --Replace 206, 31.4, 48.5 with the location of where you want all players to be teleported to at the start of the minigame
wait(2)
script.Parent.Parent.Visible = false --This removes the annoying messages Don't mess with!
game.ServerStorage.ObbyMap:clone().Parent = game.Workspace -- Make a minigame then name it just like this: Minigame1 Once it is named that, put it in the position on the map were you want it to go then put the model in lighting. After you put the model in lighting, you may delete the one in workspace if you wish.
wait(10) --How long the game lasts
script.Parent.Parent.Visible = true
script.Parent.Text = "Winner!" --After the game ends, this shows a message/messages at the end. Edit if you want.
wait(3)
script.Parent.Parent.Visible = false
game.Workspace.ObbyMap:Remove() --Removes the brick so all players die (except spectators) and removes the brick so a new game can start (recommended games aren't over 5 minutes so spectators aren't bored)
end

3 comments
Can you send a screenshot of Explorer of the part that your script is located in?
why is there a math.random in the script? is that a server script or a local script? are you trying to change the text of the message you created? if so, then you are changing the wrong text, if not, then why do you have a text label and why are you creating that message?
I think he had plans to randomly select a minigame map but got stuck on the messaging bit so he never got to code it. The answer I made is a server script and creates the message in the workspace (I think that's what he was going for) for all players to see.