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
|
  |
| 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
|
  |
| 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
|
  |
| 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 |
|
|
|
| 05 Feb 2013 05:22 AM |
| Are you trying to make a stat-point sort of upgrade system? |
|
|
| Report Abuse |
|
|