I have a GUI that I want to display the amount of cash a player has, but anything I try doesn't show any numbers, just "Text".
The leaderboard script is below.
local players = game:WaitForChild("Players") local function createLB(player) local stats = Instance.new("Folder") stats.Name = "leaderstats" local coin = Instance.new("IntValue", stats) coin.Name = "Coins" stats.Parent = player end players.PlayerAdded:connect(createLB)
Any suggestions on a script?
local Player = game.Players.LocalPlayer local Coins = Player:WaitForChild("leaderstats").Coins function SetText() script.Parent.Text = Coins.Value end SetText() Coins.Changed:Connect(function() SetText() end
Put this script in a local script and put the script within the text label you want. And it should work.
If anyone has the same issue here, this is the script I used to fix my issue.
local player = game.Players.LocalPlayer or game.Players.PlayerAdded:Wait() local leaderstats = player:WaitForChild("leaderstats") local coin = leaderstats.Coins local value = script.Parent value.Text = coin.Value coin:GetPropertyChangedSignal("Value"):Connect(function() value.Text = coin.Value end)
Feel free to use this and change as you wish.