|
| 29 Aug 2015 10:52 PM |
If someone clicks on a gui box displaying another player's name, this portion of the script is supposed to add a certain (irrelevant to this question) value to that players value called "BetOn." The gui box has a text displaying the other player's name and I'm trying to use that text to find the other player in the Players file in game. Unfortunately, I can't figure out how to do that and my best attempt failed.
GuessPlayer = script.Parent.Parent.BetName.Text game.Players.GuessPlayer.BetOn.Value = game.Players.GuessPlayer.BetOn.Value + Player.Bet.Value (lines 2 and 3 are really just one line)
GuessPlayer represents the other player's name but the script literally tries to find someone named "GuessPlayer" in line 2 and not whatever name "GuessPlayer" actually represents
|
|
|
| Report Abuse |
|
|
| 29 Aug 2015 10:58 PM |
Figured it out. For anyone curious this is how to do it
GuessPlayer = script.Parent.Parent.BetName.Text x = game.Players:FindFirstChild(GuessPlayer) x.BetOn.Value = x.BetOn.Value + Player.Bet.Value |
|
|
| Report Abuse |
|