Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Map Chooser, help? [Not Solved]

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!

2 answers

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

5 comments

0

What about the Intermission and the Ready Set Go thing? Just copy this and put it after it?

0

'chosenMap.Parent = Workspace' nil value and, There are gonna be two maps.. And I want it to teleport to the chosen map.

0

Wait I got it! Thanks!

0

Jolly good ^^

0

Actually, now that I tested it, it doesn't work..

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

2 comments

0

It's working so far! Thanks!

0

oh, so u dint need my help? cool... well, wish ya luck next time ;)

This discussion is preserved as it was. New answers, comments, and votes are closed.