generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Complecated? getting decendents of and unlocking

Previous Thread :: Next Thread 
HILLBILLYY is not online. HILLBILLYY
Joined: 08 May 2010
Total Posts: 764
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
HILLBILLYY is not online. HILLBILLYY
Joined: 08 May 2010
Total Posts: 764
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 is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
24 Apr 2014 09:03 PM
it.

Wheres my robux.
Report Abuse
HILLBILLYY is not online. HILLBILLYY
Joined: 08 May 2010
Total Posts: 764
24 Apr 2014 09:18 PM
-_y
Report Abuse
Halpar is not online. 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 is not online. 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 is not online. 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
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
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
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image