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 ! :)
COMMUNITY QUESTION
How to make a script to select a random map and put players in it?
2 answers
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!
1 comment
0
So by simply saying "Map" with no connections or anything, it runs whatever is on the end of that =?
you create the map and put players in it
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Do not spam tags on to your question. This is not allowed and will get your account suspended.