Why is my Currency Notifier showing up as a Zero?
Asked by
5 years ago Edited 5 years ago
Heyo, I was creating a lil' something, where everytime a player's currency, changes, a little notification will pop up saying the amount of currency that they have gotten. Well, I got into a small problem, (I think.) where it does not say how much currency they've gotten, but instead keep showing that they've gotten zero. It grab's the player's Cash, and subtract it by the amount of Cash they've gotten, I thought the output was, well the amount of Cash they received, I was wrong!
01 | local player = game.Players.LocalPlayer |
03 | player.leaderstats:WaitForChild( "Cash" ).Changed:Connect( function (amount) |
05 | script.Parent:WaitForChild( "cn_Sound" ):Play() |
07 | script.Parent:WaitForChild( "cn_Label1" ):TweenPosition(UDim 2. new( 0.8 , 0 , 0.48 , 0 ), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1 ) |
09 | script.Parent:WaitForChild( "cn_Label1" ).Text = "+" ..player.leaderstats:WaitForChild( "Cash" ).Value-amount.. " Cash" |
13 | script.Parent:WaitForChild( "cn_Label1" ):TweenPosition(UDim 2. new( 1 , 0 , 0.48 , 0 ), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1 ) |
Please tell me why this occurs.
~unsnap