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 » Scripting Helpers
Home Search
 

Re: Currency GUI Script

Previous Thread :: Next Thread 
Malimaxus is not online. 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 is not online. Malimaxus
Joined: 21 Feb 2010
Total Posts: 63
10 Mar 2013 04:50 PM
Bumpadump
Report Abuse
Malimaxus is not online. Malimaxus
Joined: 21 Feb 2010
Total Posts: 63
10 Mar 2013 04:52 PM
Bumpin' all day.
Report Abuse
masterblokz is not online. masterblokz
Joined: 17 Nov 2010
Total Posts: 9517
10 Mar 2013 04:53 PM
player is not defined I think, or try
player.StarterGui
not player.PlayerGui
Report Abuse
Malimaxus is not online. 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 is not online. 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 is not online. 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 is not online. Malimaxus
Joined: 21 Feb 2010
Total Posts: 63
10 Mar 2013 04:59 PM
That didn't seem to work either. :(
Report Abuse
Azarth is not online. Azarth
Joined: 17 Aug 2012
Total Posts: 2760
10 Mar 2013 05:03 PM
Where is the script located?
Report Abuse
Malimaxus is not online. Malimaxus
Joined: 21 Feb 2010
Total Posts: 63
10 Mar 2013 05:05 PM
@Azarth
Inside the LCText. Is that bad? :(
Report Abuse
Azarth is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • 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