Answered by
4 years ago Edited 4 years ago
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:
1 | local player = game.Players.LocalPlayer |
2 | local character = player.Character |
3 | local tpCFrame = CFrame.new( 100 , - 50 , 100 ) |
5 | script.Parent.MouseButton 1 Click:Connect( function () |
6 | character.HumanoidRootPart.CFrame = tpCFrame |
I hope I was able to help you today :D
Thanks for reading,
- DrShockz