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 » Scripters
Home Search
 

Re: how to reassign variables?

Previous Thread :: Next Thread 
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
30 Dec 2014 08:17 AM
blue1 = colordropper.blues.blue1
blue2 = colordropper.blues.blue2

blue2.Name = "blue1"

even though i change blue2's name to blue1, the script still thinks it is blue2.

how do i fix this?
Report Abuse
dragonkeeper467 is not online. dragonkeeper467
Joined: 24 Jan 2011
Total Posts: 472
30 Dec 2014 08:20 AM
um... variables dont have names as far as I know... try this instead

blue1 = colordropper.blues.blue1
blue2 = colordropper.blues.blue2

blue2 = blue1


-- are you trying to assign blue2 to the blue1 variable or trying to assign blue 2 to the string "blue1"
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
30 Dec 2014 08:24 AM
both, i want blue2's name to change to blue1 and also be called with 'blue1', not 'blue2'

but i'll try your method, thanks!!!
Report Abuse
dragonkeeper467 is not online. dragonkeeper467
Joined: 24 Jan 2011
Total Posts: 472
30 Dec 2014 08:27 AM
im not quite sure if you can change a variable name... I'll investigate that
Report Abuse
dragonkeeper467 is not online. dragonkeeper467
Joined: 24 Jan 2011
Total Posts: 472
30 Dec 2014 08:28 AM
dont think you can, you can only assign the value of a variable to another variable

http://wiki.roblox.com/index.php?title=Variable
Report Abuse
eLunate is not online. eLunate
Joined: 29 Jul 2014
Total Posts: 13268
30 Dec 2014 08:28 AM
Eh what -exactly- are you trying to do? Since there are very limited practical applications in scripting for what I think you're attempting
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
30 Dec 2014 08:35 AM
imagine a cup dispenser that holds 5 cups at any one time
the cups are labelled 1-5, 1 being the bottommost cup
when someone takes cup 1, it disappears from the game.
the 4 remaining cups move down and now cup 2 is the bottommost cup.

i want cup 2 to inherit cup1's properties, name, variable path etc.

basically i want cup 1 to always be the cup at the bottom, and i've been trying to switch variables so that happens.
Report Abuse
Chrapnel is not online. Chrapnel
Joined: 01 Feb 2014
Total Posts: 951
30 Dec 2014 06:06 PM
^
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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