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 make it so that when my map starts, it teleports the players to it?

This is my map changer script;~~~~~~~~~~~~~~~~~local tools = {"LinkedSword", "Flip"} -- Put the following tools in lighting

-- Put your Match starting script here below local mapDirectory = game.Lighting.Maps -- This is where your maps are! local msg = Instance.new("Message") msg.Parent = game.Lighting local time = script.Time -- Script ----------------------------------------------------------------------------------------------------

--Da Loop-- while true do -- The Loop local maps = mapDirectory:getChildren() -- Defins what maps means --End of Da Loop--

--Without the fail safe we would encounter unhealthy bugs. -----This is the fail safe----- if #maps == 0 then --Counts how many maps there are, if theres 0, removes da script. print("Maps not found! SelfRemoving...") --lets you know whats going on script:remove() --removes the script return end -- Ends this function -----Fail Safe Ends-----

---Part that picks da maps----- local pickedMap = maps[math.random(1, #maps)] --Defines Pickedmap, as 1-# of maps local pickedMapClone = pickedMap:clone() --defines what the picked map clone is pickedMapClone.Parent = game.Workspace -- defines the parent of the picked map pickedMapClone:makeJoints() -- required whenever you insert a model into the world, otherwise it falls apart (From Telamon) msg.Parent = game.Workspace --makes a message msg.Text = "Map Change!" --makes the text wait(3) --waits 3 seconds msg.Text = "Map chosen is " ..pickedMapClone.Name.."." --makes the message of what map print("Map inserted: " .. pickedMap.Name) --says when map is made wait(5) --waits 5 secs.

msg.Parent = game.Lighting
wait(time.Value) --the value time is refrenced to the time of waitness pickedMapClone:remove() --removes the cloned map

end wait(1) -- change to any number game.Workspace.tools:Clone(game.Workspace.Players.StarterPack)


1 comment

0

Did mine not work?

1 answer

✓ Accepted answer
target = game.Workspace.target
target2 = game.Workspace.target2
target3 = game.Workspace.target3
targets = {target.CFrame,target2.CFrame,target3.CFrame}
players = game.Players:GetPlayers()
for i = 1,#players do
players[i].Character.Torso.CFrame = targets[math.random(1,#targets)]-- Place a brick somewhere in the map and call it target
end

This shall teleport all the players. +1 if i helped.

10 comments

0

What if I need 2 or more points in a map?

0

Let me add on.

0

Done :P

0

lol

0

so do I call the brick target?

0

yep

0

okay, thanks :D

0

Make sure you click I answered the question button since I helped.

0

???? it didn't help!!??

0

oops sorry

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