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

Player teleport not working?

Asked by 6 years ago
Edited 6 years ago
--Teleport all the players
function teleportPlayers()
  for i,v in pairs(players) do
--will be together in script
    v.Character.HumanoidRootPart.CFrame =     
currentmap:FindFirstChild(chosenmap.Value).Spawn * CFrame.new(math.random(5,10),0,math.random(5,10))
--will be together in script_
  end
end

Here is the part of the script that is giving me problems. It will not teleport. NOTE:

1 answer

Log in to vote
0
Answered by 6 years ago

Try this:

--Teleport all the players
function teleportPlayers()
  for i,v in pairs(players) do
--will be together in script
    v.Character.HumanoidRootPart.CFrame = CFrame.new(currentmap:FindFirstChild(chosenmap.Value).Spawn * CFrame.new(math.random(5,10),0,math.random(5,10)))
--will be together in script_
  end
end

0
I thought this code would work but for some reason it still dosnt teleport the player lolapus4 9 — 6y
0
I edited this script and got it working! target = CFrame.new(0, 50, 0) --could be near a brick or in a new area for i, player in ipairs(game.Players:GetChildren()) do --Make sure the character exists and its HumanoidRootPart exists if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then --add an offset of 5 for each character player.Character.Humanoid lolapus4 9 — 6y
Ad

Answer this question