Coin Value changed

Hello! I am trying to make a script and the normal coin works but the coin change doesn’t work

Script:

local coinText = script.Parent

local coinValue = game.Players.LocalPlayer.leaderstats.Coins.Value

coinText.Text = coinValue

coinValue.Changed:Connect(function()

coinText.Text = coinValue

end)

Thanks!

leaderstats is server sided. The changes you’re making are local, so they just replicate to the client, not the server. Use a server script.

It still does not work for me.

Local script in the gui:

local plr = game:GetService("Players").LocalPlayer
local stats = plr:WaitForChild("leaderstats")
local coinText = script.Parent
coinText.Text = stats.Coins.Value

stats.Coins.Changed:Connect(function(value)
    script.Parent.Text = value
end)
1 Like