#trying to index number with Position error?

1 messages · Page 1 of 1 (latest)

silent kayak
#

so i got this code running in a moon animation event but it returns this error, here is the concerned code :

for i,v in pairs(workspace.CWMap.ballinAnim.Vines:GetChildren()) do
    for o,b in pairs(v:GetChildren()) do
        o.Position = o.Position - Vector3.new(0,8,0)
    end
end```
brittle meteor
#

Pairs and ipairs is deprecated now

#

For I, v in … do

#

Also this is the fix btw:

#
for i,v in workspace.CWMap.ballinAnim.Vines:GetChildren() do
    for _, child in v:GetChildren() do
        child.Position = child.Position - Vector3.new(0,8,0)
    end
end```
silent kayak
#

ty bro, does not using pairs in a for changed anything at the way it works?

brittle meteor
#

not really

#

pairs just loop through tables

#

ipairs is for indexing

#

and nothing at all just loops through

primal bone
#

someone told me that I dont need to use both, why?

brittle meteor
#

and both isnt needed

#

does it work tho?