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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Certain Leaderstat to be shown in a GUI

Previous Thread :: Next Thread 
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
03 Apr 2014 02:54 PM
Player.leaderstats.Kills.Value == game.StaterGui.Rank.Text
I want it to be only shown to the player. Not everyone.

Would it be:
Player.leaderstats.Kills.Value == game.LocalPlayer.StaterGui.Rank.Text
I think I am correct. But if you relised. I am making a Gun Game Game, so I need some help.
Thx for everyone's help so far, it means a lot to me. :D
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
03 Apr 2014 03:01 PM
Bump
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
03 Apr 2014 03:15 PM
Yes, you'd have to store the gui in the player's playergui to show only his/her Stats.

EX;

while wait() do
game.LocalPlayer.PlayerGui.Rank.Text = game.Players.LocalPlayer.leaderstats.Kills.Value
end
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
03 Apr 2014 03:16 PM
Okay, so if the Kills change, would that make the text change?
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
03 Apr 2014 03:27 PM
^Yup, that's what the while loop is for :P(Inefficient way to do it, but easiest, expect bugs)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 03:29 PM
Goul you got some errors. Anyway OP here is an efficient way:

local kills = Game.Players.LocalPlayer.leaderstats.Kills
game.LocalPlayer.PlayerGui.Rank.Text = kills.Value
while true do
game.LocalPlayer.PlayerGui.Rank.Text = kills.Changed:wait()
end
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 03:29 PM
local kills = Game.Players.LocalPlayer.leaderstats.Kills
local rank = Game.Players.LocalPlayer.PlayerGui.Rank

rank.Text = kills.Value
while true do
rank.Text = kills.Changed:wait()
end
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
03 Apr 2014 03:31 PM
What was wrong with my premature script? O:
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
03 Apr 2014 03:40 PM
'game.LocalPlayer'
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
03 Apr 2014 03:45 PM
Oh, haha, didn't see that.
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
04 Apr 2014 12:06 PM
This still doesn't work D:
Here is the hierarchy:
StarterGui
-Rank
--Text
---Script

Some errors in people's script like Game is supposed to be game.
Please help D:
Report Abuse
iimerkingalaxy is not online. iimerkingalaxy
Joined: 23 Sep 2013
Total Posts: 223
04 Apr 2014 12:15 PM
Narb you spelled "StaterGui" wrong the correct is "StarterGui"
Report Abuse
youssef04 is not online. youssef04
Joined: 22 Jan 2011
Total Posts: 1745
04 Apr 2014 01:01 PM
Still, makes no difference. Still doesn't work.
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