Hello! Im trying to make a custom GUI interface that contains the usernames and stats in a list, but it looks a bit difficult for me.
I have an example here what I want to do. Link from Imgur:
I really need to get their names and stats, then show the interface to all players. It is just an example.
I have to use lists or tables but I'm not very good at that. I checked this too
https://developer.roblox.com/en-us/api-reference/lua-docs/table https://developer.roblox.com/en-us/articles/Table
I would be grateful if someone has time to explain this well to me. From already thank you very much.
To insert a player's name on a Gui TextButton, simply insert a local script into that specific text button and write the following;
1 | script.Parent.Text = game.Players.LocalPlayer.Name |
To put a specific stat on a Gui that was on a leaderboard, for example, all you simply do is the following; In this example we will use a stat called minutes.
1 | local player = game.Players.LocalPlayer |
2 | local minutes = player:WaitForChild( "leaderstats" ):WaitForChild( "Minutes" ) --change that to whatever you named the leaderstat |
3 |
4 | script.Parent.Text = minutes.Value |
5 |
6 | minutes:GetPropertyChangedSignal( "Value" ):Connect( function () |
7 | script.Parent.Text = minutes.Value |
8 | end ) |