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: Is there a way to refer to this?

Previous Thread :: Next Thread 
lawl60ftw is not online. lawl60ftw
Joined: 30 May 2009
Total Posts: 3973
05 Feb 2013 02:41 AM
So this is a little hard to explain, but I'm making an upgrade button for an rpg and I'm trying to refer to one line that can be changed without making multiple lines of script.

So, I'm referring to [upgrading] but it doesn't work because I think it has something to do with the fact that it's a TextLabel and the Text changes whenever you click a new attunement.

upgrading = script.Parent.CA.Statsbox.Upgrading.Text

player[attuning].Value = player[attuning].Value + 1



The Text is "StrongHands", which is the name of the upgrade, but I didn't want to use player.StrongHands.Value because then I'd have to write a line for each attunement.

Is there another way to refer to multiple without specifying or writing it out 50 times?
Report Abuse
thane1326 is not online. thane1326
Joined: 08 Apr 2009
Total Posts: 867
05 Feb 2013 04:03 AM
Instead of using string to get the upgrade, why not have a numbervalue?
Report Abuse
lawl60ftw is not online. lawl60ftw
Joined: 30 May 2009
Total Posts: 3973
05 Feb 2013 05:15 AM

player = game.Players.LocalPlayer
upgrading = script.Parent.CA.Statsbox.Upgrading.Text




if player[upgrading].Value < 5 then
if player.Attunementpoints.Value >= 1 then
messg.Title.Text = "Your attunement has been upgreded. You now have "..player.Attunementpoints.Value.." Attunement Points left"
messg.Text.Text = "Upgrade successful"
player.Attunementpoints.Value = player.Attunementpoints.Value - 1
player[attuning].Value = player[attuning].Value + 1
messagefadein()
wait(3)
messagefadeout()


How would I be able to use a NumberValue in this? Unless you're talking about replacing the string's location with a Numbervalue.
The location of the string has to be something that can hold letters because it searches for the name of the string as a leaderboard value.
This means I don't have to write as many lines for exact commands, rather than writing it once and allowing it to detect all leaderboard values.
Like I said, the string's text will change when you select a different attunement which is how I pinpoint the certain leaderboard value I'm looking for.

A numbervalue will not help at all like I said, unless you mean replacing the string's location with a numbervalue which probably won't work either.

Report Abuse
lawl60ftw is not online. lawl60ftw
Joined: 30 May 2009
Total Posts: 3973
05 Feb 2013 05:20 AM
I also experimented with a NumberValue just then and they only hold numbers.

Think of the string's location as bridge legs, you need it to allow both sides to connect.
Report Abuse
NINJAKID09 is not online. NINJAKID09
Joined: 27 Aug 2009
Total Posts: 14392
05 Feb 2013 05:22 AM
Are you trying to make a stat-point sort of upgrade system?
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