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!
local player = game.Players.LocalPlayer
player.leaderstats:WaitForChild("Cash").Changed:Connect(function(amount)
script.Parent:WaitForChild("cn_Sound"):Play()
script.Parent:WaitForChild("cn_Label1"):TweenPosition(UDim2.new(0.8, 0, 0.48, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
script.Parent:WaitForChild("cn_Label1").Text = "+"..player.leaderstats:WaitForChild("Cash").Value-amount.." Cash"
wait(4)
script.Parent:WaitForChild("cn_Label1"):TweenPosition(UDim2.new(1, 0, 0.48, 0), Enum.EasingDirection.Out, Enum.EasingStyle.Sine, 1)
end)
--keeps showing up as zero!!!
Please tell me why this occurs. ~unsnap
