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

How do I go about making Rounds?

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

✓ Accepted answer

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()

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)?

4 comments

0

Yeah! And we have four maps, as mentioned in the description.

0

Alright :P do you want me to make a script for you?

0

Yes, thank you SO much. We'll be giving credit to you in our game. :)

0

Ok XD Ill send it to you in pm then.

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