Roblox Scripting Tutorial: Map Changing (Minigames) Script
Script:
while true do
wait(60) --Waits 1 minute in between games
m = Instance.new("Message") --Creates a new message
local players = game.Players:GetChildren() -- String array where we store all the players
local num = math.random(1,1) --Here, put (1,[total number of maps]
if num == 1 then --Copy and paste this next section for each map, changing the number from 1 to 2, 3, and so on.
m.Parent = game.Workspace --Puts our message in Workspace
m.Text = "Choosing Minigame..." --Feel free to change these next couple of lines as needed
wait(4)
m.Text = "Game Number " ..num.. " Was Chosen"
wait(3)
m.Text = "[MAP NAME]; Maker: [MAP MAKER NAME]"
wait(3)
m.Text = "[INSTRUCTIONS]"
wait(3)
m.Text = "This game lasts for [TIME]."
wait(3)
m.Parent = nil
game.Lighting.Minigame1:clone().Parent = game.Workspace --Change the "Minigame1 to the name of your map (stored in Lighting)
for i = 1, # players do
players[i].Character:MoveTo(Vector3.new(-53.723, 346.569, 91.323)) --Change these coordinates to where you want the players to spawn
game.Lighting.LinkedSword:clone().Parent = players[i].Backpack --Change LinkedSword to the name of a weapon (in Lighting) you want to give to the players. You can either delete this line or copy paste more of it.
end
wait(120) --This is how long the game will last
game.Workspace.Minigame1:Remove() --Change Minigame1 to the name of your map.
m.Parent = game.Workspace
m.Text = "Game over! Thank you for playing!"
wait(3)
m.Text = "You have 1 minute until the start of the next game."
wait(3)
m.Parent = nil
end
m:Remove()
end
Want to help make this channel better? You can donate to me via Roblox Robux!
http://ow.ly/En9x30hdeWy
Be sure to follow Laura and I on Twitter after rating, commenting, and subscribing!
Me :https://twitter.com/Rrrrry123
Laura: https://twitter.com/lauraperry123
Also, follow me on Twitch for some live streams!
http://www.twitch.tv/Rrrrry123
Other Videos By RyGuyGaming
Other Statistics
Roblox Statistics For RyGuyGaming
At present, RyGuyGaming has 459,946 views spread across 106 videos for Roblox, and roughly a days worth of Roblox videos were uploaded to his channel. This makes up 17.76% of the content that RyGuyGaming has uploaded to YouTube.