I'm trying to make a paintball game for my friend. But the map chooser isn't working.. Neither does the Paintball gun clone. (To backpack) Help?
MSG = game.Workspace.WGM maps = {"Dome","PaintballOriginal"} while true do MSG.Text = "Intermission..." wait(15) MSG.Text = "Starting new game..." wait(10) MSG.Text = "Starting up..." wait(5) MSG.Text = "Ready..." wait(3) MSG.Text = "Set..." wait(3) MSG.Text = "Go!" wait(2) MSG.Text[math.random(#maps)] --stuff wait() game.Lighting.LinkedPaintballGun:Clone(backpack) end
Thanks!
Line 16, you're only giving a string, to load a map you need the actual map:
MapList = game.ReplicatedStorage.Maps GunList = game.ReplicatedStorage.Guns while wait() do -- countdown etc chosenMap = MapList:GetChildren()[math.random(#MapList:GetChildren()):Clone() chosenMap.Parent = Workspace chosenMap:MoveTo( Vector3.new(0,0,0) ) -- if you want a specific position for _,v in pairs(GunList:GetChildren()) do if v:IsA("Tool") or v:IsA("HopperBin") then for _,p in pairs(game.Players:GetChildren()) do p.Backpack:ClearAllChildren() -- don't want an overflow of tools. v:Clone().Parent = p.Backpack end end end MSG.Text = chosenMap.Name end
Dome = game.Lighting.Dome PaintballOriginal = game.Lighting.PaintballOriginal maps = {Dome, PaintballOriginal} while true do MSG = Instance.new(Message) --Put speech marks inside, sry, mine don't work MSG.Parent = game.Workspace MSG.Text = "Intermission..." wait(15) MSG.Text = "Starting new game..." wait(10) MSG.Text = "Starting up..." wait(5) MSG.Text = "Ready..." wait(3) MSG.Text = "Set..." wait(3) MSG.Text = "Go!" wait(2) MSG.Text = maps[math.random(#maps, 1)] --If u want it in the Text, else if u want it to actually pick a map, then just tell me... this sentence tells the system to pick something from the Table called maps, and the number 1 tells the system to pick just 1 out of the Table, if u'd want more, u could say 2, but not for maps --stuff wait() game.Lighting.LinkedPaintballGun:Clone.Parent = game.Players.LocalPlayer.Backpack --Just an example, sry, but am a lil confused wen it comes to doing stuff with all the Players... also, this sentance is Cloning the Gun and then telling the system that the Clone's Parent is the Player's Backpack end
Hope I helped :D