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: Online "Explorer" Script

Previous Thread :: Next Thread 
ZeroSpectrum is not online. ZeroSpectrum
Joined: 02 Mar 2011
Total Posts: 315
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
ZeroSpectrum is not online. ZeroSpectrum
Joined: 02 Mar 2011
Total Posts: 315
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
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
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
ZeroSpectrum is not online. ZeroSpectrum
Joined: 02 Mar 2011
Total Posts: 315
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 is not online. 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
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