Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How can i edit the HumanoidRootPart's properties?

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

✓ Accepted answer

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)

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

6 comments

0

So how would i write the script ?

0

Well for starters you replace the property with CFrame and learn CFrame values as in CFrame.new()

0

I don't know if you meant literrally change Position for CFrame and let the rest of the script the same

0

Can you help me by making the script, i got lost and have no idea now

0

sigh CFrame is a property in basepart instances

0

i placed a sample

This discussion is preserved as it was. New answers, comments, and votes are closed.