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

X is not a valid member of part. Am I doing it wrong?

Asked by 7 years ago
Edited 7 years ago
local part = script.Parent.Parent.FoxSeat
local i = 1
local model = script.Parent.Parent
local plat = model.platform
local Pointa = model.pointA
local Pointb = model.pointB
local bodyPos = plat.BodyPosition
local time = 6.5 --Time between motion


while true do
    bodyPos.position = Pointa.Position
    wait(0.1)
    if bodyPos.position == Pointa.position then
    for i = 1,180 do
wait(0.1)
    part = Vector3.new(part.X +1, part.Y, part.Z)
wait(time)
    bodyPos.position = Pointb.Position
    wait(0.1)
    if bodyPos.position == Pointb.position then
    for i = 1,180 do
wait(0.1)
    part = Vector3.new(part.X +1, part.Y, part.Z)
wait(time)
                end
            end
        end
    end
end


local i = 1

0
Code block please. X is not a child of part, which means your Parents are wrong, X has never been there, you really mean part.Size.X or part.Position.X, or you need to wait for X to load in to Part. Azarth 3141 — 7y
0
It's not at all necessary to keep defining i jotslo 273 — 7y
0
Your problem is that you're trying to call upon a property/ object that doesn't exist (w/in the parent object); if you want the Size/ Position, you are required to do BasePart.Size/ BasePart.Position, then retrieve the values from there. TheeDeathCaster 2368 — 7y

1 answer

Log in to vote
-1
Answered by
farrizbb 465 Moderation Voter
7 years ago
Edited 7 years ago

Do

part:WaitForChild("X")

THis is because x might of not loaded yet.

0
Oh sorry read the information wrong. farrizbb 465 — 7y
Ad

Answer this question