Hi there,
I’ve got this script that is meant to update Text when the Value of coins is updated it’s working but its using the old Value of “currentcoins” when i need it to get the latest Value and display the change of the Values
Script:
local player = game.Players.LocalPlayer
local coinstat = player:WaitForChild(“coinstats”)
local coins = coinstat:WaitForChild(“Coins”)
local text = script.Parent.Amount
local function currentCoins()
local newCoins = coins.Value - currentcoins
text.Visible = true
text.Text = "+: "…newCoins
wait(2)
text.Visible = false
end
coins:GetPropertyChangedSignal(“Value”):Connect(currentCoins)
currentcoins = coins.Value
Thanks,