Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Map Chooser, help? [Not Solved]

Asked by 10 years ago

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

Log in to vote
0
Answered by
hiccup111 231 Moderation Voter
10 years ago

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
0
What about the Intermission and the Ready Set Go thing? Just copy this and put it after it? DDDropTheBase 0 — 10y
0
'chosenMap.Parent = Workspace' nil value and, There are gonna be two maps.. And I want it to teleport to the chosen map. DDDropTheBase 0 — 10y
0
Wait I got it! Thanks! DDDropTheBase 0 — 10y
0
Jolly good ^^ hiccup111 231 — 10y
0
Actually, now that I tested it, it doesn't work.. DDDropTheBase 0 — 10y
Ad
Log in to vote
-1
Answered by
KAAK82 16
10 years ago
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

0
It's working so far! Thanks! DDDropTheBase 0 — 10y
0
oh, so u dint need my help? cool... well, wish ya luck next time ;) KAAK82 16 — 10y

Answer this question