Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Teleporting players isn't working?

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)

1 comment

0

it could be because you're executing it through a LocalScript. you should use RemoteEvents to tell the server to teleport the player.

1 answer

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

3 comments

0

Oops sorry. I didnt knwo that you were telporting a player. I thoguth that you were teleporting all the players.

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!

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.