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

How to teleport a player through a script?

Asked by 3 years ago

I'm using this code and it doesn't work!

game.Workspace.Player.HumanoidRootPart.CFrame = CFrame.new(Vector3.new(-0.59, 177.93, -32.51))
0
I have specified this in my previous answer to your last question. https://scriptinghelpers.org/questions/105164/why-isnt-the-player-being-teleported hpenney2 53 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Your script can be better. The main issue is the conversion of vector3 to cframe. You have 2 ways to fix this:

Option 1: get rid of Vector3. This would be done by modifying your script:

game.Workspace.Player.HumanoidRootPart.CFrame = CFrame.new(-0.59, 177.93, -32.51)

The position would be the same as Vector3, they are just different methods.

Option 2: get rid of CFrame. Your script wouldn't change the CFrame via script, but the Position (which will change the CFrame). Your script:

game.Workspace.Player.HumanoidRootPart.Position = Vector3.new(-0.59, 177.93, -32.51)

I hope this answers your question.

Ad

Answer this question