I'm trying to make it so that the player teleport in a specific area but it doesn't wanna work
local player = game.Players.LocalPlayer
player.Humanoid.HumanoidRootPart.Position = Vector3.new(54.86, 0.5, -77.58)
I'm trying to make it so that the player teleport in a specific area but it doesn't wanna work
local player = game.Players.LocalPlayer
player.Humanoid.HumanoidRootPart.Position = Vector3.new(54.86, 0.5, -77.58)
Well, There Is A New And Better Way To Identify The Character:
local Player - game.Players.LocalPlayer -- // This Is You
local MainPos = Vector3.new(54.86, 0.5, -77.58) -- // MainPos .. MainPosition
local Character = game.Workspace:WaitForChild(Player.Name) -- // New Way To Identify The Character
local HumanoidRootPart = Character:WaitForChild('HumanoidRootPart') -- // Identifying The HumanoidRootPart
HumanoidRootPart.Position = MainPos -- // Setting The HumanoidRootPart Pos To MainPos
local Character = game.Workspace:WaitForChild(Player.Name) is not a new way of defining the Character, there's obviously a reason why we have a property of the Player which is Player.Character.
Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.
Bro Nobody Understands What You Are Saying Why Don't You Just Answer This Question Your Self?
you didn't index character before the humanoid
local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:Wait() -- Checking if character is added
if Charcter:FindFirstChild("Humanoid") then -- Checking If there's a humanoid
Character.Humanoid:FindFirstChild("HumanoidRootPart").Position = Vector3.new(54.86, 0.5, -77.58)
end
HumanoidRootPart is not a child of the Humanoid. Have you tested your code?
Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Changing the position of the HumanoidRootPart on the client will result in the HumanoidRootPart to be moved instead of the entire character. Use CFrame instead of position.