How to teleport to different places?
I have a teleport script but instead of teleporting players to their individual spaces it teleports everybody to the same place, the area where the first player teleports no matter where it is, here is the script:
01 | if game.Workspace.VeryEasy.VeryEasy.A.Value = = "" or game.Workspace.VeryEasy.VeryEasy.A.Value = = script.Parent.Parent.Parent.Parent.Name then |
02 | game.Workspace.VeryEasy.VeryEasy.A.Value = script.Parent.Parent.Parent.Parent.Name |
03 | script.Parent.Parent.Visible = false |
05 | game.Workspace.VeryEasy.VeryEasyA [ "1" ] .Position = Vector 3. new( 18662 ,math.random( 7.5 , 10.5 ),math.random( 2219 , 2227 )) |
06 | game.Workspace.VeryEasy.VeryEasyA [ "2" ] .Position = Vector 3. new( 18682 ,math.random( 7.5 , 10.5 ),math.random( 2219 , 2227 )) |
07 | game.Workspace.VeryEasy.VeryEasyA [ "3" ] .Position = Vector 3. new( 18702 ,math.random( 7.5 , 10.5 ),math.random( 2219 , 2227 )) |
08 | game.Workspace.VeryEasy.VeryEasyA [ "4" ] .Position = Vector 3. new( 18722 ,math.random( 7.5 , 10.5 ),math.random( 2219 , 2227 )) |
09 | game.Workspace.VeryEasy.VeryEasyA.Time.Value = 120 |
11 | game.Workspace.VeryEasy.VeryEasyA [ "1" ] :RemoveAllChildren() |
12 | game.Workspace.VeryEasy.VeryEasyA [ "2" ] :RemoveAllChildren() |
13 | game.Workspace.VeryEasy.VeryEasyA [ "3" ] :RemoveAllChildren() |
14 | game.Workspace.VeryEasy.VeryEasyA [ "4" ] :RemoveAllChildren() |
16 | elseif game.Workspace.VeryEasy.VeryEasy.B.Value = = "" or game.Workspace.VeryEasy.VeryEasy.B.Value = = script.Parent.Parent.Parent.Parent.Name then |
17 | game.Workspace.VeryEasy.VeryEasy.B.Value = script.Parent.Parent.Parent.Parent.Name |
19 | game.Workspace.VeryEasy.VeryEasyB [ "1" ] .Position = Vector 3. new( 18662 ,math.random( 7.5 , 10.5 ),math.random( 2230 , 2238 )) |
20 | game.Workspace.VeryEasy.VeryEasyB [ "2" ] .Position = Vector 3. new( 18682 ,math.random( 7.5 , 10.5 ),math.random( 2230 , 2238 )) |
21 | game.Workspace.VeryEasy.VeryEasyB [ "3" ] .Position = Vector 3. new( 18702 ,math.random( 7.5 , 10.5 ),math.random( 2230 , 2238 )) |
22 | game.Workspace.VeryEasy.VeryEasyB [ "4" ] .Position = Vector 3. new( 18722 ,math.random( 7.5 , 10.5 ),math.random( 2230 , 2238 )) |
23 | game.Workspace.VeryEasy.VeryEasyB.Time.Value = 120 |
25 | game.Workspace.VeryEasy.VeryEasyB [ "1" ] :RemoveAllChildren() |
26 | game.Workspace.VeryEasy.VeryEasyB [ "2" ] :RemoveAllChildren() |
27 | game.Workspace.VeryEasy.VeryEasyB [ "3" ] :RemoveAllChildren() |
28 | game.Workspace.VeryEasy.VeryEasyB [ "4" ] :RemoveAllChildren() |
...
function TeleportSlot1()
game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso.CFrame = CFrame.new(18641, 13, 2223)
end
function TeleportSlot2()
game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso.CFrame = CFrame.new(18641, 13, 2234)
end
function TeleportSlot3()
game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso.CFrame = CFrame.new(18641, 13, 2245)
end
function TeleportSlot4()
game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso.CFrame = CFrame.new(18641, 13, 2256)
end
function TeleportSlot5()
game.Workspace[script.Parent.Parent.Parent.Parent.Parent.Name].Torso.CFrame = CFrame.new(18641, 13, 2267)
end