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
 

How would I do this?

Previous Thread :: Next Thread 
TaxRevenue is not online. TaxRevenue
Joined: 13 Apr 2011
Total Posts: 36313
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 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
10 Mar 2012 12:47 PM
b = "Base"

game.workspace[b]:Remove()
Report Abuse
TaxRevenue is not online. TaxRevenue
Joined: 13 Apr 2011
Total Posts: 36313
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 is not online. 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
TaxRevenue is not online. TaxRevenue
Joined: 13 Apr 2011
Total Posts: 36313
10 Mar 2012 12:53 PM
What are strings?
And what are they for?

I'm confused..

lol..
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
10 Mar 2012 12:54 PM
Strings are basicly just text...
Report Abuse
slayer9365 is not online. slayer9365
Joined: 22 Oct 2007
Total Posts: 2312
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
TaxRevenue is not online. TaxRevenue
Joined: 13 Apr 2011
Total Posts: 36313
10 Mar 2012 12:55 PM
so I could just do game.Workspace.Base:delete() instead of remove?
Report Abuse
su8 is not online. su8
Joined: 06 Mar 2009
Total Posts: 6334
10 Mar 2012 12:57 PM
:Destroy()
Report Abuse
slayer9365 is not online. slayer9365
Joined: 22 Oct 2007
Total Posts: 2312
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
slayer9365 is not online. slayer9365
Joined: 22 Oct 2007
Total Posts: 2312
10 Mar 2012 12:58 PM
Sorry for the late post, thanks for the clarafication on that su8
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