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

How do I make make maps random?

Asked by 4 years ago
Edited by theking48989987 4 years ago
function minigameModule:chooseMap()
    local chosenMap = mapsStorage[#mapsStorage]:Clone()
    if findFirstChild(chosenMap, "Spawns") then
        chosenMap.Parent = workspace
        chosenMap:MakeJoints()
        self.currentMap = chosenMap
        return chosenMap
    end
end
0
I would put your functions into an array and then use math.random to pick a random item from the table. Jexpler 63 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You need to use ChosenMap = math.random(1,#mapsStorage) So bassicly if that did not work just use math.random.

Ad

Answer this question