Problems teleporting a player

I’ve been trying to teleport a player to a specific location when a button on a GUI is pressed. The thing is every time I join the game I don’t know if the teleport system will actually work. It will either teleport next to the object, or it will work.

The script:

local telbutton = script.Parent
local telPart = game.Workspace.TelParts.ThemeBlue.TelPart1
local telPartPos = telPart.CFrame
local player = game.Players.LocalPlayer

telbutton.Activated:Connect(function()
	player.Character.LowerTorso.CFrame = telPartPos
end)

Any fix to this?

1 Like

The problem is your running it on the local side try this:

player.Character:PivotTo(telPartPos)

this will work on the local side

2 Likes

You are amazing thank you so much for helping me! :smiley:

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.