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

How do I go about making Rounds?

Asked by
wddd89 35
10 years ago

I know this is a HUGE FAVOR, but I really want to know. A friend and I are trying to develop a game and we need to know how to make maps switch around a bit (to add variety, of course!) and we currently have four or so. If you can reply with a concept of the script (no need for the whole script, i can never learn if i just get things handed to me) i'll be eternally grateful. Thanks.

2 answers

Log in to vote
2
Answered by 10 years ago

What you would need to do: Put all the maps into Lighting/ServerStorage

Put all the maps into a table, use math.random, and then load it into Workspace.

A script if you want it:

--[[
All you need to do is put all the maps into Lighting, and name them "Map" + a random number
Example:
> Lighting
-->Map1
-->Map2
etc
]]--
maps = {}

function LoadMaps()
    for i,v in pairs(game.Lighting:GetChildren()) do
        if string.lower(string.sub(v,1,3)) == "map" then
            table.insert(maps, v.Name)
        end
    end
end

LoadMaps()

function SelectMap()
    local n = math.random(1,#maps)
    local map = game.Lighting:FindFirstChild(maps[n])
    local newmap = map:Clone()

    newmap.Parent = game.Workspace
end

SelectMap()
Ad
Log in to vote
0
Answered by 10 years ago

Well, first of all, would you like it to be randomly selected, and how many maps are there? And do you want a hint appearing saying: LOADING:(MAP NAME)?

0
Yeah! And we have four maps, as mentioned in the description. wddd89 35 — 10y
0
Alright :P do you want me to make a script for you? deputychicken 226 — 10y
0
Yes, thank you SO much. We'll be giving credit to you in our game. :) wddd89 35 — 10y
0
Ok XD Ill send it to you in pm then. deputychicken 226 — 10y

Answer this question