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 do I define this?

Previous Thread :: Next Thread 
MilkyWay01 is not online. MilkyWay01
Joined: 22 Feb 2010
Total Posts: 1049
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
MilkyWay01 is not online. MilkyWay01
Joined: 22 Feb 2010
Total Posts: 1049
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
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