|
| 01 Oct 2014 03:31 AM |
open=false The script always breaks at "if v:IsA('Instance') then", which is confusing because what else could be hiding under the game object that ISN'T an instance? It doesn't even skip over the objects that somehow aren't instances without breaking.
pos=0 scope=1 frame=script.Parent:WaitForChild('frame') button=frame:WaitForChild('button')
button.MouseButton1Click:connect(function() if not open then open=true button.Text='- Game' scope=scope+1 for i,v in ipairs (game:GetChildren()) do if v:IsA('Instance') then pos=pos+20 local b=button:Clone() b.Parent=button.Parent b.Text='+ '..v.Name b.Position=UDim2.new(0,10*scope,0,pos) end end end end) |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2014 03:32 AM |
[Edit] Put the "open" variable where it is supposed to be. If the roblox forums had an option to edit posts I wouldn't have to bump my thread uselessly.
The script always breaks at "if v:IsA('Instance') then", which is confusing because what else could be hiding under the game object that ISN'T an instance? It doesn't even skip over the objects that somehow aren't instances without breaking.
open=false pos=0 scope=1 frame=script.Parent:WaitForChild('frame') button=frame:WaitForChild('button')
button.MouseButton1Click:connect(function() if not open then open=true button.Text='- Game' scope=scope+1 for i,v in ipairs (game:GetChildren()) do if v:IsA('Instance') then pos=pos+20 local b=button:Clone() b.Parent=button.Parent b.Text='+ '..v.Name b.Position=UDim2.new(0,10*scope,0,pos) end end end end) |
|
|
| Report Abuse |
|
|
|
| 01 Oct 2014 07:00 AM |
| Why do you need to check if it is an instance? Just remove that conditional, and it will work fine. |
|
|
| Report Abuse |
|
|
|
| 03 Oct 2014 12:56 AM |
Removed that line, it wasn't the problem.
22:55:03.810 - An error occurred 22:55:03.811 - Script 'Players.Player1.PlayerGui.ScreenGui.Script', Line 16 22:55:03.811 - Stack End 22:55:03.812 - Disconnected event because of exception
line 16 is:
b.Text='+ '..v.Name
so for some reason one of the instances under game does not have a .Name property? |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 03 Oct 2014 01:12 AM |
| Its because you aren't allowed to access all the children of Game |
|
|
| Report Abuse |
|
|