How can i make it play the sound when credits have increased and not play when it has decreased.

local player = game.Players.LocalPlayer

player.leaderstats.Credits.Changed:connect(function()
script.Parent.CoinCollect:Play()
script.Parent.TextLabel.Text = "Credits: "..player.leaderstats.Credits.Value
end)

1 comment

0

Why not just play the audio when the script you are using it for changes their credits, as you know the credits would be going up? Like, in the same script that adds a credit, play the sound.