Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 04:49 PM |
I am trying to make a currency GUI script with a variable for the currency, but it's not working for some reason. I don't get any errors either. It just doesn't show up. It just shows up as "Legend Coins:". Here's the script I made for it (not working, of course):
local LC = 0
game.Players.PlayerAdded:connect(function(player) player.PlayerGui.LegendCoins.LCFrame.LCText.Text = "Legend Coins: "..LC end)
|
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
| |
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
| |
|
|
| 10 Mar 2013 04:53 PM |
player is not defined I think, or try player.StarterGui not player.PlayerGui |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 04:55 PM |
| StarterGui will change EVERYONE'S currency, wouldn't it? I had that problem before. |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 10 Mar 2013 04:55 PM |
@master, StarterGui is a child of game, PlayerGui is a child of player. he defined 'player' in the .PlayerAdded event
@op local LC = 0
game.Players.PlayerAdded:connect(function(player) pGui = player:WaitForChild("PlayerGui") pGui.LegendCoins.LCFrame.LCText.Text = "Legend Coins: "..tostring(LC) end)
~ Failure is the road to success ~ |
|
|
| Report Abuse |
|
|
Usering
|
  |
| Joined: 18 Aug 2012 |
| Total Posts: 10281 |
|
|
| 10 Mar 2013 04:57 PM |
PlayerGui is local; http://wiki.roblox.com/index.php/PlayerGui StarterGui is server; http://wiki.roblox.com/index.php/RBX.lua.StarterGui_(Object)
~ Failure is the road to success ~ |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 04:59 PM |
| That didn't seem to work either. :( |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 10 Mar 2013 05:03 PM |
| Where is the script located? |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 05:05 PM |
@Azarth Inside the LCText. Is that bad? :( |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 10 Mar 2013 05:08 PM |
PlayerAdded won't be detected inside a GUI
local LC = 1
game.Players.Changed:connect(function(player) local pGui = player.PlayerGui pGui.LegendCoins.LCFrame.LCText.Text = "Legend Coins: "..tostring(LC) end) |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 10 Mar 2013 05:09 PM |
| Disregard that, why are you activating it with PlayerAdded? It should be linked to leaderstats. O.o |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 05:11 PM |
@Azarth Oh. Now that I put it out in the Workspace it works. I wish I knew that earlier. XD |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 05:12 PM |
@Azarth Well, I think it's a little easier to understand. But hey, it works! :P |
|
|
| Report Abuse |
|
|
Malimaxus
|
  |
| Joined: 21 Feb 2010 |
| Total Posts: 63 |
|
|
| 10 Mar 2013 05:15 PM |
| Oh wait, scratch that, I'm gonna link it to leaderstats now. O_o |
|
|
| Report Abuse |
|
|