Why is my current money not showing up in the gui?

I am currently making a weapons store for my game but the problem I have is that the money I have current does not appear in the gui.

I will hide the list of players which cannot be seen so that’s why I want it to be seen in the same store gui

image

the script is this:

local leaderstats = instance.new("Model")
leaderstats.Name = "leaderstats"
leaderstats.parent = Player
local Money = leaderstats.Money

Player:WaitForChild("leaderstats"):Connect(function()
Script.Parent.borde.sueldo.Text = Money.Value
end)
1 Like

Make sure it’s a local script. And then type this:

local player = game:GetService("Players").LocalPlayer
local playerMoney = player.leaderstats.Money

while true do
    wait()
    if script.Parent.borde.sueldo.Text ~= playerMoney.Value then
        script.Parent.borde.sueldo.Text = playerMoney.Value
    end
end
1 Like

Try this, it worked for me:

local Money = player.leaderstats.Money
Money:GetPropertyChangedSignal("Value"):Connect(function()
script.Parent.borde.sueldo.Text = "$"..Money.Value
end)

Also, I suggest you watch the following video on how to create a Leaderboard:

1 Like

Hey there!

Looking through the code you provided there is an error in your script as to why it’s not updating. In your script you did Player:WaitForChild("leaderstats"):Connect(function() this connects to nothing and wont update and instead just error. The correct way to do what you want is the following code below;

local gui= -- put path to gui here

Player:WaitForChild("leaderstats"):GetPropertyChangedSignal("Value"):Connect(function()
    gui.Text = Money.Value
end)

What this does is activates once the value of money has changed, then changing the text of the gui to the money value.
Read up on GetPropertyChangedSignal

1 Like

oh thank you for your help if it served me only that I received the notification very late and I barely saw it thanks for the help!