|
| 04 Feb 2016 10:16 AM |
Ok so I have 2 scripts the first is to spawn gun 10 seconds after you spawn, the second is a minigame script. Can you guys pls help me merge these so the gun is given 10 seconds after spawning and leaves at the end of the round. Sorry about the length. Any help will be mentioned on the games special thanks GUI. ~vaughn99951
Spawn script: player = game.Players.LocalPlayer wait(10) game.Lighting.Gun:Clone() gun.parent = player.Backpack
Minigame: games = 5 --How many minigames Only ten unless you know how to edit waittime = 30 --Wait time in between minigames gametime = 120 --The time the minigame lasts
game1name = "Void Forest" --Name of the first minigame. game2name = "Obstacles" --Name of the second minigame. game3name = "Mountains of Sorrow" --Name of the third minigame. game4name = "Endless Sea" --Name of the fourth minigame. game5name = "Open Field" --Name of the fifth minigame.
game1position = -20.5, 28.5, -98.9 --Must be in x,y,z form. Where do people spawn for the 1st game? game2position = 305, 20.5, -64 --Must be in x,y,z form. Where do people spawn for the 2nd game? game3position = 81, 20.5, -32.9 --Must be in x,y,z form. Where do people spawn for the 3rd game? game4position = 119, 5.3, -225 --Must be in x,y,z form. Where do people spawn for the 4th game? game5position = 5,5,5 --Must be in x,y,z form. Where do people spawn for the 5th game?
--To make minigames, put each minigame in Lighting. *The name of the model must be the name of the minigame.*
----------------------------------------------------------------------------------------------------------------------------------- IMPORTANT STUFF BELOW! DO NOT EDIT!
while true do wait(waittime) local m = math.random(1,games) local player = game.Players:GetPlayers() for i = 1, #player do msg = Instance.new("Message") msg.Parent = nil if m == 1 then msg.Parent = game.Workspace msg.Text = "The next map is... Void Forest" wait(4) msg.Text = game1name wait(3) msg.Text = "The game will be starting in:" wait(1) msg.Text = "***3***" wait(1) msg.Text = "**2**" wait(1) msg.Text = "*1*" wait(1) msg.Text = "!START!" wait(2) player[i].Character:MoveTo(Vector3.new(game1position)) player[i].Character:MoveTo(Vector3.new(game1position)) player[i].Character:MoveTo(Vector3.new(game1position)) msg:remove() game.Lighting:findFirstChild(game1name):clone().Parent = game.Workspace wait(gametime) --time of game msg.Parent = game.Workspace msg.Text = "Finished with that map!" wait(2) --time that the message shows up. msg:remove() game.Workspace:findFirstChild(game1name):Remove() end if m == 2 then msg.Parent = game.Workspace msg.Text = "The next map is... Obstacles" wait(2) msg.Text = game2name wait(3) msg.Text = "The game will be starting in:" wait(1) msg.Text = "***3***" wait(1) msg.Text = "**2**" wait(1) msg.Text = "*1*" wait(1) msg.Text = "!START!" wait(1) player[i].Character:MoveTo(Vector3.new(game2position)) player[i].Character:MoveTo(Vector3.new(game2position)) player[i].Character:MoveTo(Vector3.new(game2position)) msg:remove() game.Lighting:findFirstChild(game2name):clone().Parent = game.Workspace wait(time) msg.Parent = game.Workspace msg.Text = "Completed" wait(2) msg:remove() game.Workspace:findFirstChild(game2name):Remove() end if m == 3 then msg.Parent = game.Workspace msg.Text = "The next map is... Mountains of Sorrow" wait(2) msg.Text = game3name wait(3) msg.Text = "The game will be starting in:" wait(1) msg.Text = "3" wait(1) msg.Text = "2" wait(1) msg.Text = "1" wait(1) msg.Text = "Start!" wait(1) player[i].Character:MoveTo(Vector3.new(game3position)) msg:remove() game.Lighting:findFirstChild(game3name):clone().Parent = game.Workspace wait(gametime) msg.Parent = game.Workspace msg.Text = "Finished with that map!" wait(2) msg:remove() game.Workspace:findFirstChild(game3name):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 if m == 4 then msg.Parent = game.Workspace msg.Text = "The next map is... Endless Sea" wait(2) msg.Text = game4name wait(3) msg.Text = "The game will be starting in:" wait(1) msg.Text = "3" wait(1) msg.Text = "2" wait(1) msg.Text = "1" wait(1) msg.Text = "Start!" wait(1) player[i].Character:MoveTo(Vector3.new(game4position)) msg:remove() game.Lighting:findFirstChild(game4name):clone().Parent = game.Workspace wait(gametime) msg.Parent = game.Workspace msg.Text = "Finished with that map!" wait(2) game.Lighting:findFirstChild("Tee Hee").Parent = game.Workspace msg:remove() game.Workspace:findFirstChild(game4name):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 if m == 5 then msg.Parent = game.Workspace msg.Text = "The next map is... Open Field" wait(2) msg.Text = game5name wait(3) msg.Text = "The game will be starting in:" wait(1) msg.Text = "3" wait(1) msg.Text = "2" wait(1) msg.Text = "1" wait(1) msg.Text = "Start!" wait(1) player[i].Character:MoveTo(Vector3.new(game5position)) msg:remove() game.Lighting:findFirstChild(game5name):clone().Parent = game.Workspace wait(gametime) msg.Parent = game.Workspace msg.Text = "Finished with that map!" wait(2) game.Lighting:findFirstChild("Tee Hee").Parent = game.Workspace msg:remove() game.Workspace:findFirstChild(game5name):Remove() --Removes the brick so all players die (except spectators) and removes the brick so a new game can start end end end |
|
|
| Report Abuse |
|
|
| 04 Feb 2016 11:13 AM |
function msg(text,time) local message = Instance.new('Message',workspace).Text=text wait(time) message:remove() end
msg('START',1)
--just a way to shorten your script. |
|
|
| Report Abuse |
|
|
| 04 Feb 2016 11:30 AM |
| What do I alter to make both work? |
|
|
| Report Abuse |
|