|
| 07 Jan 2015 01:19 PM |
Hello everyone! I have a little problem, and i hope that someone here have the solution!
I have a line of code that should change the players gui: Game.Players.PlayerName.PlayerGui.ScreenGui.Frame.Totalmoney.Value = 100
(PlayerName is the players name)
It outputs 'PlayerName is not a valid member of Players' which i can understand why but how can i fix it? |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 07 Jan 2015 01:23 PM |
Game.Players.PlayerName.PlayerGui.ScreenGui.Frame.Totalmoney.Value = 100 ... Game.Players.PlayerName
... I hope you're actually kidding me or I will risk life and limb to steal Russia's nuclear weapons -just- to nuke your computer. |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Jan 2015 01:49 PM |
First, make sure the script is a local script. Next, add this variable to the top of the script:
local player = game.Players.LocalPlayer
And modify the line you have to look like this:
game.Players:FindFirstChild(player.Name).PlayerGui.ScreenGui.Frame.Totalmoney.Value = 100
It should work then. |
|
|
| Report Abuse |
|
|
| |
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 07 Jan 2015 01:54 PM |
'local player = game.Players.LocalPlayer
And modify the line you have to look like this:
game.Players:FindFirstChild(player.Name).PlayerGui.ScreenGui.Frame.Totalmoney.Value = 100'
You already got the local player why not just do
local player = game.Players.LocalPlayer player.PlayerGui.ScreenGui.Frame.Totalmoney.Value = 100 |
|
|
| Report Abuse |
|
|
|
| 07 Jan 2015 01:59 PM |
| ^ Ahh yeah, very true. Oops. |
|
|
| Report Abuse |
|
|