Yea mb, I’m going step by step. I’m still fairly new to scripting so it takes me some time to figure things out
I saw the image you uploaded. If the seats are parented to the chair and you couldn’t set the seats parented to same instance then you could just use a table that including all of the seats and change the for loop to it.
for _Index, Seat in pairs(Table) do
....
end
Can I change the Value.Occupant to Value.Seat.Occupant?
The problem I’m having is that the Value isn’t on the seat but on the parent of the seat
If the Value is the parent of the Seat then you can. But remember that this must be valid for all of the seats. So on all of the seats must be parented to Value.
Yes, it is true, I wouldn’t have suggested it otherwise. Will try it right now
If I use ipairs(Chairs:GetDescendants()) then the Value will be Model and not the Seat it seems, do I fix this by giving it :GetChildren?
:GetChildren() method only assigns child’s as value. :GetDescendants() method is getting all of the instances parented to it, even children’s children’s.
Yea the GetChildren works now. Thanks a lot man!
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.