Hello! Hope you're having a great day :D
I see you're struggling to move the player's position, and I'd personally recommend you use CFrame this is a very powerful property as it stores everything about a part, position, rotation, size, etc.
Also to move the player you'd want to teleport it by it's primary part which is usually HumanoidRootPart
So in your script, this is how we would implement it:
First, you will want to put a part where you want the player to teleport.
Then in the console at the bottom of your studio input the below command:
print(game.Workspace["YOUR PART HERE"].CFrame.Position)
The output will look like so:
100, -50 ,100
Now that we have that we can do this:
local player = game.Players.LocalPlayer
local character = player.Character
local tpCFrame = CFrame.new(100, -50, 100)
script.Parent.MouseButton1Click:Connect(function()
character.HumanoidRootPart.CFrame = tpCFrame
end)
I hope I was able to help you today :D
Thanks for reading,
2 comments
i did it does the same thing
can you try character:MoveTo(Vector3.new(-51.185, 6.295, 17.411))?