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

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

Asked by 5 years ago
Edited 5 years ago

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

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 NSMascot 113 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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.)

0
Nope, it's stuck in an infinite wait for the "PetPosition". It seems it doesn't recognise it.. ady1111 8 — 5y
0
That means that PetPosition just isn't there. Not sure why, but it isn't. CeramicTile 847 — 5y
Ad
Log in to vote
-1
Answered by
Neu_Dev 22
5 years ago
local vector = pet.PetPosition -- this should be changed to:
local vector = pet.Position
0
or local vector = PetPosition.Position if he is reffering to petposition as a part Robowon1 323 — 5y
0
I don't need the position. It just doesn't recognise "PetPosition" as a child of Part. ady1111 8 — 5y

Answer this question