|
| 06 Apr 2013 12:08 AM |
Im trying to make a Gui Map Loader. So when I click "Obby 1" The first obby will load. I can make a map load but when I try to make it so the map will remove when I click a different map. What I have is not working and I cannot figure out what I am doing wrong. Can someone please help?
function onClick() game.Lighting.Obby1:clone().Parent = game.Workspace game.Workspace.Obby2:remove() end
script.Parent.MouseButton1Click:connect(onClick) |
|
|
| Report Abuse |
|
|
| |
|
logan520
|
  |
| Joined: 24 Nov 2010 |
| Total Posts: 846 |
|
|
| 06 Apr 2013 12:12 AM |
Quite hard if its a Multiplayer server, due to the fact that everyone will be on certain levels.
I'd suggest (If making this game in the way I'm thinking it), make a Max Player script with Maxplayers = 1. Or make a ServerLock script that lets only 1 Player in each server.
Anyways, Hmm... Seems to me like you just need to switch the Obby1 and Obby2 around in Seperate scripts. I'm not that advanced though, so it may not help as much.
Hope the Above helped in any way possible! :D |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 12:15 AM |
| Maybe I need to do an if game.Workspace.Obby2.Parent = game.Workspace then game.Workspace.Obby2:remove()? |
|
|
| Report Abuse |
|
|
logan520
|
  |
| Joined: 24 Nov 2010 |
| Total Posts: 846 |
|
| |
|
|
| 06 Apr 2013 12:20 AM |
| Your Idea worked. Your the best, It was so simple I cant believe I didnt do that...Iv'e been trying to complicate everything. Thanks man! |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 06 Apr 2013 12:25 AM |
(I am Logan520 before you ask 'Hey, I said that to him'. This is my Projects Holder Alt)
No problem! I really had no idea, I was just throwing out some stuff that was in my head. Man, I guess im getting(Atleast)0.5% better at Lua every day! :D |
|
|
| Report Abuse |
|
|
|
| 06 Apr 2013 12:27 AM |
| Hey, If you wanna learn Lua just go to LuaLearners. It explains Lua in a great way and at the end of every tutorial they put what they taught you to the test and make a script. |
|
|
| Report Abuse |
|
|
FoggedOut
|
  |
| Joined: 09 Dec 2011 |
| Total Posts: 3021 |
|
|
| 06 Apr 2013 12:31 AM |
Well, I have the Original 'ROBLOX Lua' book, and I have a 'Python Beginners' book. I'm reading both, and they actually helped me with some commmands like 'while true do' and 'then' and 'end' and stuff like that.
Thank you, I may actually look into LuaLearners. |
|
|
| Report Abuse |
|
|
| |
|
|
| 06 Apr 2013 12:51 AM |
Use :Destroy()
:remove() sets the parent to nil, keeping it in the game
:Destroy() removes it'self, and all child instances, as well as descendants. |
|
|
| Report Abuse |
|
|