I'm new to Lua and Stack so I apologize in advance. I'm currently using a tycoon kit to create a Roblox game, and the player's money value only shows up on the leaderboard, but nowhere on the screen. This can make it hard to know how much money you have on console and mobile, so I'm trying to set up a GUI to display the player's amount of money on the screen. Now, setting up the GUI isn't the issue, knowing what to set the text value on the GUI is.
I do not know how to upload am image, but the path in my workspace looks a bit like this: Players (on the first tab of the workspace)-> Player-> leaderstats-> Cash
I've tried to grab the variable (named "Cash") like this: game.Players.Player.leaderstats.Cash.Value
but because I'm not named "Player", it didn't work. I've tried replacing it with LocalPlayer (looked like game.Players.LocalPlayer.leaderstats.Cash.Value
), but that also didn't work. It only works when I replace "Player" with my username (game.Players.Username.leaderstats.Cash.Value
), but I want this to work for other players besides me.
I've also tried to locate the original variable, but because I did not make the kit I'm at a loss. I've looked in every script that comes with it, but could not find anything.
When I try to set the text to these values, nothing happens. The error message I get falls along the lines of Player is not a valid member of Players
.
Any help would be greatly appreciated!
game.Players.Username
asUsername
. – Corsaka