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

How to make a script to select a random map and put players in it?

Asked by 10 years ago

I really don't know how to script so can someone help me? And i'd like someone to help me making a game that i've thinked. It would be a great game, or just answer the question would be appreciated too ! :)

0
Do not spam tags on to your question. This is not allowed and will get your account suspended. User#11893 186 — 10y

2 answers

Log in to vote
0
Answered by 10 years ago

To do this, you first put your maps in ServerStorage.

local Map1 = Game.ServerStorage.Map1
local Map2 = Game.ServerStorage.Map2

and so on and so forth. Next you would have to choose a map, with Number being the amount of maps you have.

Map = math.random(Number)
if Map == 1 then Map = Map1
elseif Map == 2 then Map = Map2

etc. Then you would get the map and put the players in it. You would put a part called targetpoint where they will be teleported.

Map:Clone(Workspace)
target = Map.targetpoint
for i, player in pairs(game.Players:GetChildren()) do
    player.Character.Torso.CFrame = target + Vector3.new(0, i * 5, 0)
end

That's it!

0
So by simply saying "Map" with no connections or anything, it runs whatever is on the end of that =? AwsomeSpongebob 350 — 9y
Ad
Log in to vote
0
Answered by 4 years ago

you create the map and put players in it

Answer this question