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

How can i edit the HumanoidRootPart's properties?

Asked by 4 years ago
local Players = game:GetService("Players")
local Part = script.Parent
?
Part.Touched:connect(function(part)
    local plr = Players:GetPlayerFromCharacter(part.Parent)
    plr.HumanoidRootPart.Position = Vector3.new(22.79, 2.5, 105.545)
end)

Also there is NO error at all I would REALLY appreciate some help

2 answers

Log in to vote
0
Answered by 4 years ago

LIke @chloe_price65 said, player instances do not have a HumanoidRootPart. Only the character has a HumanoidRootPart.

Sample:

local HRP = player.Character.HumanoidRootPart

player.Character is the important part that you were missing.

Then, you can simply do what you have done.

HRP.Position = Vector3.new(22.79, 2.5, 105.545)
Ad
Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Use CFrame instead of Position. I don't know exactly why, but it will help teleporting your character.

Also check your output, because Player Instances do not have HumanoidRootParts, their characters do.

Sample:

HumanoidRootPart.CFrame = CFrame.new(0,0,0) --> origin
0
So how would i write the script ? Pipe_Gamerz 4 — 4y
0
Well for starters you replace the property with CFrame and learn CFrame values as in CFrame.new() SoftlockedUnderZero 668 — 4y
0
I don't know if you meant literrally change Position for CFrame and let the rest of the script the same Pipe_Gamerz 4 — 4y
0
Can you help me by making the script, i got lost and have no idea now Pipe_Gamerz 4 — 4y
View all comments (2 more)
0
sigh CFrame is a property in basepart instances SoftlockedUnderZero 668 — 4y
0
i placed a sample SoftlockedUnderZero 668 — 4y

Answer this question