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: Randomly stops working

Previous Thread :: Next Thread 
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:24 PM
NumberOfMaps = #Game.Lighting.Maps:GetChildren()

Maps = { }

for Index, Map in pairs( Game.Lighting.Maps:GetChildren( ) ) do --A

table.insert( Maps, Map:Clone( ) )

end --A

while wait(0.03) do --B

for Number = 1,NumberOfMaps do --C

Maps[Number].Parent = Workspace

Workspace.HintMessage.Text = Workspace[Number].MapName.Value

wait(5)

Maps[Number]:Destroy()

end--C

end --B


It will insert the first map, remove it

Insert the second map, and before it removes it...

16:23:06.402 - The Parent property of 1 is locked
16:23:06.404 - Script "Workspace.GameScript", Line 15
16:23:06.406 - stack end
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
24 Mar 2013 04:25 PM
What class is '1'?

Reported for spam.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:26 PM
What spam? I'm asking for help...

I don't understand your question.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:27 PM
Oh wait I understand now sorry.

1 is a model.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Mar 2013 04:29 PM
Try using Remove() instead.

(╯°□°)> KMXD
Report Abuse
dekkonot is not online. dekkonot
Joined: 22 Dec 2010
Total Posts: 6685
24 Mar 2013 04:30 PM
Remove() is deprecated. Use Destroy() instead.

Reported for spam.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:30 PM
Well even if remove isn't the best...If it works it works. I'll try it.
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Mar 2013 04:31 PM
I know that. Just try using Remove.

(╯°□°)> KMXD
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:33 PM
Still doesn't work

I also tried

NumberOfMaps = #Game.Lighting.Maps:GetChildren()

Maps = { }

for Index, Map in pairs( Game.Lighting.Maps:GetChildren( ) ) do --A

table.insert( Maps, Map:Clone( ) )

end --A

while wait(0.03) do --B

for Number = 1,NumberOfMaps do --C

Maps[Number].Parent = Workspace

Workspace.HintMessage.Text = Workspace[Number].MapName.Value

wait(5)

Game.Workspace[Number]:Destroy()

end--C

end --B


Didn't work
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:37 PM
I have no idea why but it started working kinda.

No error, but it doesn't loop.

NumberOfMaps = #Game.Lighting.Maps:GetChildren()

Maps = { }

for Index, Map in pairs( Game.Lighting.Maps:GetChildren( ) ) do --A

table.insert( Maps, Map:Clone( ) )

end --A

while wait(0.03) do --B

for Number = 1,NumberOfMaps do --C

Maps[Number].Parent = Workspace

Workspace.HintMessage.Text = Workspace[Number].MapName.Value

wait(5)

Maps[Number]:Destroy()

end --C

end --B
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Mar 2013 04:37 PM
Try this:

    NumberOfMaps = #Game.Lighting.Maps:GetChildren()
    Maps = { }
    for Index, Map in pairs( Game.Lighting.Maps:GetChildren( ) ) do --A
    table.insert( Maps, Map:Clone( ) )
    end --A
    
    while wait(0.03) do --B
    for Number = 1, NumberOfMaps do --C
    Maps[Number]:Clone().Parent = Workspace
    wait(5)
    Workspace[Number]:Destroy()
    end--C
    end --B

(╯°□°)> KMXD
Report Abuse
LamborghiniAventa is not online. LamborghiniAventa
Joined: 22 Jun 2012
Total Posts: 1518
24 Mar 2013 04:39 PM
Maybe you should write it differently and stick a while true do in there.
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:41 PM
Works thanks, what did you change? I don't see it, what was wrong?
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
24 Mar 2013 04:43 PM
I just made it so that it clones the clone of the map.

(╯°□°)> KMXD
Report Abuse
UnBuild is not online. UnBuild
Joined: 22 Mar 2013
Total Posts: 3233
24 Mar 2013 04:44 PM
Ohhhh, Thanks.
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