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

Teleporting players isn't working?

Asked by 4 years ago

I want to teleport players with my GUI (It's something like a whitelist) but everytime I teleport them they just get back to their old spot.

local TextBox = script.Parent.Button.teleport


    script.Parent.Button.teleport.FocusLost:connect(function(enterPressed)
            if enterPressed then
local PlayerToFind = TextBox.Text
local plr1 = game.Players.LocalPlayer.Character
local plr2 = game.Workspace:FindFirstChild(PlayerToFind)
  plr2.HumanoidRootPart.CFrame = CFrame.new(-5951.962, -62.35, -4557.551)
TextBox.Text = "WHITELISTED"
wait(1)
TextBox.Text = "Whitelist:"
   wait(2)
end
end)
0
it could be because you're executing it through a LocalScript. you should use RemoteEvents to tell the server to teleport the player. Mayk728 855 — 4y

1 answer

Log in to vote
0
Answered by 3 years ago
local Players = game.Players


for i, players in ipairs(Players:GetPlayers()) do
players.SetPrimaryCFrame(--your value--)
end

I don't know if this actually works, but if it works, alert me

0
Oops sorry. I didnt knwo that you were telporting a player. I thoguth that you were teleporting all the players. Finty_james 269 — 3y
0
I didn't expect someone to reply 1 year after I've made this haha. It's obviously already fixed but thank you for helping me! DeAuroraxx 50 — 3y
0
I didn't expect someone to reply 1 year after I've made this haha. It's obviously already fixed but thank you for helping me! DeAuroraxx 50 — 3y
Ad

Answer this question