|
| 24 Apr 2014 08:46 PM |
How would i make a script that gets every item and the items in the items of the items in lighting
like game.Lighting:GetChildren() but then searches those children to, And if that item can be locked then it copys the name kind of and then searches the workspace for all items that are locked and are also found in lighting and unlocks only those specific items, I will pay 1000 robux for this script anyone? |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2014 09:01 PM |
| Nvm think i got script working, But if your first person to post it on here then ill go ahead and pay you since i said i would |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
| |
|
| |
|
Halpar
|
  |
| Joined: 21 Apr 2014 |
| Total Posts: 91 |
|
|
| 24 Apr 2014 09:19 PM |
for index, child in pairs(Lighting:GetChildren()) do print("Index: ", index) print("Child: ", child) end |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 24 Apr 2014 09:26 PM |
He means
function getDecendants(instance) local tab = instance:children() local returntab = {} for _,v in pairs(tab) do table.insert(returntab,v.Name) if next(v:children(),nil) then for _,v in pairs(getDecendants(v)) do table.insert(returntab,v) end end end return returntab end
Something of that idea. |
|
|
| Report Abuse |
|
|
Halpar
|
  |
| Joined: 21 Apr 2014 |
| Total Posts: 91 |
|
|
| 24 Apr 2014 09:38 PM |
function Rip(objTop, funcRequest, funcAction) local coo=objTop:GetChildren() for _,v in ipairs(coo) do if funcRequest(v) then funcAction(v) end Rip(v, funcRequest, funcAction) end end
This script finds ALL of the children of the first argument specified (objTop), tests a function on ALL childs of the object (funcRequest), and runs a function on them if they match the criteria (funcAction). |
|
|
| Report Abuse |
|
|
|
| 24 Apr 2014 10:06 PM |
local items = {)
function search(item) for w = 1,#item do search(item[w]) table.insert(items,item[w]:GetFullName()) end end
Print(items)
|
|
|
| Report Abuse |
|
|
|
| 24 Apr 2014 10:08 PM |
Oops.
local items = {)
function search(item) for w = 1,#item do search(item[w]) table.insert(items,item[w]:GetFullName()) end end search(game.Lighting) Print(items)
This prints the directory of each item in lighting along with its descendants. |
|
|
| Report Abuse |
|
|