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: gui textlabel shows userdata stat?

Previous Thread :: Next Thread 
Sk8erDan is not online. Sk8erDan
Joined: 22 Mar 2010
Total Posts: 4565
12 Sep 2017 08:16 PM
how would I do it so a textlabel in a GUI shows a userdata statistic?

these are the stats:

sessionData[player] = {Credits = 0, Stops = 0}



i am not very good with userdata and just started, so i appreciate any help.
Report Abuse
Sk8erDan is not online. Sk8erDan
Joined: 22 Mar 2010
Total Posts: 4565
12 Sep 2017 08:19 PM
b1
Report Abuse
Sk8erDan is not online. Sk8erDan
Joined: 22 Mar 2010
Total Posts: 4565
12 Sep 2017 08:34 PM
wow scripters is very dead
Report Abuse
Brandon5220 is not online. Brandon5220
Joined: 11 Oct 2013
Total Posts: 499
12 Sep 2017 08:39 PM
First, I would use a datastore for those values. Then I would do this.

CREDITSGUI.Text = player.stats.Credits.Value


Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
12 Sep 2017 08:43 PM
since you're using a table, everything will be slightly different as compared to the method with int values involved



this is rather simple; all u need to do is just change the text into the specified object inside the table's value:

gui.Text = sessionData[player]["Credits"]

of course, you still need to define player, and get the data from the module script to the local script so it'd be:

local sessionData = require(--directory to the module script)
local player = game.Players.LocalPlayer --using a local script since this involves guis

gui.Text = sessionData[player]["Credits"]


Report Abuse
Sk8erDan is not online. Sk8erDan
Joined: 22 Mar 2010
Total Posts: 4565
12 Sep 2017 08:57 PM
i get the following error:

Players.Sk8erDan.PlayerGui.Hub.credits.TextLabel.LocalScript:4: attempt to index field '?' (a nil value)
Report Abuse
Sk8erDan is not online. Sk8erDan
Joined: 22 Mar 2010
Total Posts: 4565
13 Sep 2017 03:02 PM
bump, i really need help with this.
Report Abuse
gohan31865 is not online. gohan31865
Joined: 30 Jan 2011
Total Posts: 895
13 Sep 2017 05:28 PM
give us the entire script and we'll talk


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