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

Why does it say it's not a valid member of the Part?

So I made a script that Clones the "Part" from the ReplicatedStorage and adds it to the player character and there's a localscript inside the part which doesn't seem to recognise the Vector3Value instance as a member aswell.

Here's the localscript:

local head = script.Parent.Parent.Parent:WaitForChild("LowerTorso")
local pet = script.Parent
local vector = pet.PetPosition

while true do
wait()


 local p = head.CFrame * vector.Value
 pet.BodyGyro.CFrame = head.CFrame
 pet.BodyPosition.Position = Vector3.new (p.x, p.y, p.z)
end

And here's a photo of the Explorer: https://imgur.com/seoYvrI

Also by the way, the script does set the disabled value of the localscript as false.

The output error is: PetPosition is not a valid member of Part

1 comment

0

if you are stuck with a pet system, use mine (but try and do it yourself though): https://www.roblox.com/library/4315243185/NamelessGuy2005s-Pet-Shop-V1

2 answers

On line three, try changing it to this

local vector = pet:WaitForChild("PetPosition")

It could be that it's loading after you try to declare the variable. (I'm not sure if it is the real problem because it's a cloned part but what the hey, may as well try.)

2 comments

0

Nope, it's stuck in an infinite wait for the "PetPosition". It seems it doesn't recognise it..

0

That means that PetPosition just isn't there. Not sure why, but it isn't.

local vector = pet.PetPosition -- this should be changed to:
local vector = pet.Position

2 comments

0

or local vector = PetPosition.Position if he is reffering to petposition as a part

0

I don't need the position. It just doesn't recognise "PetPosition" as a child of Part.

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