|
| 12 Apr 2015 01:32 PM |
local function get(obj) for i, v in pairs(obj:GetChildren()) do table.insert(Descendants, v) get(v) end end
I forgot how to look for Descendants properly :/
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 01:33 PM |
Take away the local.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:36 PM |
still same :P
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:38 PM |
function get(obj) local Descendants = {} for i, v in pairs(obj:GetChildren()) do table.insert(Descendants, v) for ii,vv in pairs(get(v)) do table.insert(Descendants, vv) end end return Descendants end |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:41 PM |
war have u Tested this?
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 01:43 PM |
Get all descendants?
local Get = function(par) local all = {} for _,v in next, par:GetChildren() do table.insert(all,#all + 1,v) recurse = function(p) for _,v in next, p:GetChildren() do table.insert(all,#all + 1,v) recurse(v) end end recurse(v) end return all end
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:47 PM |
are u srs? o.O all of the Attempts give the same Result! if it rlly matters am using a Plugin...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 01:49 PM |
I have never made a plugin, that is probably effecting something. The script I gave works fine standard.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:51 PM |
ah well... I had 1 made with a while loop in it and it Worked with a Plugin...
btw, are u srs??? I made like 8 (some aren't the reall deal or watever, so cut it down to 4 maybe) and now is my 9th...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 01:53 PM |
I don't know how to make them :(
Following the instructions on the wiki led me to rage quitting learning them when everything the wiki said was wrong.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:55 PM |
loool! XD
it's EASY! XD
local tb = plugin:CreateToolbar('Name') local btn = tb:CreateButton( 'Press me'; 'Do it Now!'; 'asset link from Picture' ) btn.Click:connect(function() --do stuff end)
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 01:56 PM |
plugin errors because it's a nil value.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 01:58 PM |
yeah in Command Bar or Normal Scripts XDDD if in Command Bar then use PluginManager
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 12 Apr 2015 02:00 PM |
No I followed the instructions exactly with the disabled local script, errors still.
I script -~ chimmihc |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 02:02 PM |
chim, PM me, I'll tell u EXACTLY how to do it XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Apr 2015 02:09 PM |
lol... btw, if u wanna know chim, I found out that u can make a Temporary Plugin from CrazyMan... from his Twitter XD
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Apr 2015 02:13 PM |
local function GetDescendants(root, classes, tab) local tab = tab or {} for _, class in pairs(type(classes) == "string" and {classes or "Instance"} or classes or "Instance") do for index, child in pairs(pcall(game.IsA, root, "Instance") and root:GetChildren() or {}) do if ({pcall(game.IsA, child, class)})[2] == true then tab[#tab + 1] = child end GetDescendants(child, class, tab) end end return tab end
Should work as a plugin and in regular scripts. The plugin should be able to fetch more objects since it has a higher security context. |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Apr 2015 02:16 PM |
Small fix: local function GetDescendants(root, classes, tab) local tab = tab or {} for _, class in pairs(type(classes) == "string" and {classes or "Instance"} or classes or {"Instance"}) do for index, child in pairs(pcall(game.IsA, root, "Instance") and root:GetChildren() or {}) do if ({pcall(game.IsA, child, class)})[2] == true then tab[#tab + 1] = child end GetDescendants(child, class, tab) end end return tab end |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 02:27 PM |
em sry, but y all those Args??? I only need 1 for checking it... :/
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Apr 2015 02:34 PM |
root --// thing you want to search. I.e. game classes --// allows you to pass a table of classes i.e {"Part", "WedgePart", "Script"} --// You can leave this as nil if you want all objects. You can just pass a string if you are looking for one object i.e. "ModuleScript" tab --// The table we store objects in, since I am using recursion and not using a global table I have to pass a reference to the table so that all the objects get stored in the same table. --// When initially calling the function you can have it add to a table of your choosing or pass nothing (nil) and it will generate it's own table. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 02:37 PM |
ah well, I got no other choice, no offence or anything, just don't like using un-necessary things in my Code :/
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 12 Apr 2015 02:44 PM |
| The peripherals have little impact on performance, you you're free to boil it down to a more rudimentary form. |
|
|
| Report Abuse |
|
|
|
| 12 Apr 2015 02:48 PM |
lol I nearly thought u said 'Rudamentality' XD which am looking at right now XD their Game...
"My Life is going Good... but..." |
|
|
| Report Abuse |
|
|