New money income display

i have everything done but i want to do a display (display is done too) that shows the new money that the player got. “+1 money” something like that.

i thought about getting the cash value before the money update and after the money update to calculate the new money but idk how since this function fires with the changed event

local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats")
local value = leaderstats:WaitForChild("Cash")

value.Changed:Connect(function()
	script.Parent.Text = "$".. tostring(value.Value)
end)

It’s pretty simple, actually. Initialize the value:

local lastValue = value.Value

Whenever the value changes:

-- get the amount it changed
local changedAmount = value.Value - lastValue

-- do display here...

-- update
lastValue = -- value.Value
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.