local frame = script.Parent.Frame
local button = script.Parent.TextButton
local moneycount = game.Players.LocalPlayer.MoneyCount
function getMoney()
frame:TweenPosition(UDim2.new(0.5,-100,0.5,-25),'Out','Quint',.5)
wait(.75)
frame:TweenPosition(UDim2.new(0.5,-100,10,-25),'In','Quint',.5)
end
local function addMoney()
wait(.5)
moneycount.Value = moneycount.Value + 1
wait(1.25)
end
button.MouseButton1Click:Connect(addMoney)
button.MouseButton1Click:Connect(getMoney)
So this script is for whenever I click a button it sends up a message saying you earned money and it adds money to an IntValue. What I want to do is make sure that everytime the message comes up money is added to your IntValue, but when I repeatedly click the button, it adds money and the message doesn't pop up. Can somebody help me?

1 comment
Still not working. When I click the button repeatedly, it adds money, but the message doesn't show up at the same time. I want to make sure that the money only gets added when the message pops up.