|
| 13 Feb 2016 11:59 AM |
I know i can use getchildren and go through that process. but is there an easier way of getting the children from a child. It sucks i cant just use find first child.
|
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:01 PM |
| It depends on what you're trying to do, but if you don't have a specific name you're trying to find GetChildren is the next most popular way. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:18 PM |
Nah. Why don't you like GetChildren?
local children = Model:GetChildren()
for i = 1, #children do if children[i].Name == "NameOfWhatYoureLookingFor" then print 'found it' end end
or
for i,v in pairs(model:GetChildren()) do if v.Name == "NameOfWhatYoureLookingFor" then print 'found it' end end |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:20 PM |
I did. Heres what i got.
local _M = { players = {} }
function _M.checktable(tab,what) for _,i in pairs (tab) do if i and i == what then return true end end end
_M.checktable(_M.playing,player)
I get this error
13:19:45.772 - ReplicatedStorage.ServerKick:12: bad argument #1 to 'pairs' (table expected, got nil)
|
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:29 PM |
bump
I am the god. God god god ga-ga-ga-gagad. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:36 PM |
| _M.playing -- are u sure this is a table |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:37 PM |
Yes, you can see at at the top, and im able to insert decedents into it with table.insert
I am the god. God god god ga-ga-ga-gagad. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:46 PM |
bump
I am the god. God god god ga-ga-ga-gagad. |
|
|
| Report Abuse |
|
|
|
| 13 Feb 2016 12:50 PM |
omg. Im sorry i wrote _M.playing when it was _M.players whoops
I am the god. God god god ga-ga-ga-gagad. |
|
|
| Report Abuse |
|
|
| |
|