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

How do I make it so that when my map starts, it teleports the players to it?

Asked by 10 years ago

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)

~~~~~~~~~~~~~~~~~

0
Did mine not work? HexC3D 830 — 10y

1 answer

Log in to vote
1
Answered by
HexC3D 830 Moderation Voter
10 years ago
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.

0
What if I need 2 or more points in a map? zachhg03 35 — 10y
0
Let me add on. HexC3D 830 — 10y
0
Done :P HexC3D 830 — 10y
0
lol zachhg03 35 — 10y
View all comments (6 more)
0
so do I call the brick target? zachhg03 35 — 10y
0
yep HexC3D 830 — 10y
0
okay, thanks :D zachhg03 35 — 10y
0
Make sure you click I answered the question button since I helped. HexC3D 830 — 10y
0
???? it didn't help!!?? HexC3D 830 — 10y
0
oops sorry zachhg03 35 — 10y
Ad

Answer this question