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

How to teleport to different places?

Asked by 8 years ago

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:

01if 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
04    TeleportSlot1()
05    game.Workspace.VeryEasy.VeryEasyA["1"].Position = Vector3.new(18662,math.random(7.5,10.5),math.random(2219, 2227))
06    game.Workspace.VeryEasy.VeryEasyA["2"].Position = Vector3.new(18682,math.random(7.5,10.5),math.random(2219, 2227))
07    game.Workspace.VeryEasy.VeryEasyA["3"].Position = Vector3.new(18702,math.random(7.5,10.5),math.random(2219, 2227))
08    game.Workspace.VeryEasy.VeryEasyA["4"].Position = Vector3.new(18722,math.random(7.5,10.5),math.random(2219, 2227))
09    game.Workspace.VeryEasy.VeryEasyA.Time.Value = 120
10    wait(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()
15    CanActivate = true
View all 29 lines...

...

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

0
This is only the 2 parts of script that has to do with teleporting. DivineObliteration 9 — 8y
0
Try caching the individual spaces in a global table,then iterating through that table and the playerlist to teleport the players to those positions. Reshiram110 147 — 8y
0
Well what this script basically does is once you click a gui it checks if there is a player in the first slot, if not it teleports you, if so it checks second slot and so on. So if you are talking about something like for i, v, in pairs do then I don't think that would work, though I'll try before making false assumptions, thanks. DivineObliteration 9 — 8y
0
Sorry I am a loser at scripting and can't figure out how to implement global functions to a script like this. any other ideas? By the way I am trying to make a rifle range, hoping to help my horrible aim lol. Aside from this and one other random problem everything works :D DivineObliteration 9 — 8y
0
the method is ClearAllChildren and not RemoveAllChildren 1waffle1 2908 — 8y

Answer this question