I have this as a function you know.

It basically has to find a BodyForce objects in the table something.

All it does right now is print naa, which means it is wrong.

bfs is a seperate table that is suppose to be a table of only all the BodyForce objects, excluding other things because I used :GetChildren() to create the table of the list of descendants.

function getStuff(something)

local bfs = {}

for i,v in pairs(something) do

if v:FindFirstChild("BodyForce") then print'yes' bfs[i] = v

else print'naa' return end end

return bfs

end

(Couldn't code block, but this is best format I could do. Sorry)

Can you find out why? because I've tried all I could...unfortunately to no good.

Right now the BodyForce is working, but I'm trying to limit the amount of BodyForce objects that get created.

This is because I use a Touched event, and it parents BodyForce to whatever touches the part. However, sometimes it can create way too many if you continuously step on the same part. I am trying to enforce a limit to how many can be created.

4 comments

0

Ask me questions if you would like more information.

0

put it in a code block

0

yea

0

It ought to work. Be sure you're checking for the bodyforce in the correct place. Also, use https://wiki.roblox.com/index.php?title=API:Class/Instance/FindFirstChildOfClass