|
| 10 Mar 2012 12:47 PM |
I'm trying to make a base removing script in ROBLOX Studio using a variable. How would I do it?
Like this?
b = Base
game.workspace.b:Remove()
Help please. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Mar 2012 12:47 PM |
b = "Base"
game.workspace[b]:Remove() |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 12:49 PM |
Why do I need to put "Base" in quotations?
And also, why do I need 2 brackets between the b? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Mar 2012 12:51 PM |
Uhm.. It's because you need to access objects in workspace by the names which are strings
You need those because you can use variables which are strings like strings if it's between [] |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 12:53 PM |
What are strings? And what are they for?
I'm confused..
lol.. |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
|
| 10 Mar 2012 12:54 PM |
| Strings are basicly just text... |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 12:54 PM |
If you don't want to save the base as a variable youc an do game.Workspace.Base:remove()
although I think remove is depreciated, and it is now delete or something like that. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 12:55 PM |
| so I could just do game.Workspace.Base:delete() instead of remove? |
|
|
| Report Abuse |
|
|
su8
|
  |
| Joined: 06 Mar 2009 |
| Total Posts: 6334 |
|
| |
|
|
| 10 Mar 2012 12:57 PM |
| Yes, that would forcibly remove it so that it could not come back. I know that remove is the same as making the parent nil, but you can still access it. You should check the delete function thouhg, I am not sure if that is it, or how you spell it. |
|
|
| Report Abuse |
|
|
|
| 10 Mar 2012 12:58 PM |
| Sorry for the late post, thanks for the clarafication on that su8 |
|
|
| Report Abuse |
|
|