Needing help with simple IntValue Increment Increase

Good Day, I’m making it so when you click the button, the cash value (which is located in a folder, called stats inside the Local Player) is increased by 1. I just can’t seem to get my head around what’s the problem, and I’m so tired. Help would be appreciated.

My Local Script
--//Variables\\--

local plr = game:GetService('Players').LocalPlayer

local Button = script.Parent

local moneygui = plr.PlayerGui.MoneyGui.Frame

local Event = game:GetService('ReplicatedStorage').RemoteEvent

local cashvalue = plr.Stats.Cash

Button.MouseClick:Connect(function()

    Event:FireServer()

end)

My Server Script

game:GetService('ReplicatedStorage'):FindFirstChild('RemoteEvent').OnServerEvent:Connect(function(player)

    local cashvalue = player.Stats.Cash

    cashvalue.Value = cashvalue.Value + 1

end)

My Button
23

Can’t figure out what I’m missing. Maybe it’s my brain on lack of oxygen? Any help is greatly appreciated!

3 Likes

Where is the LocalScript in the explorer? It sounds like it’s under the button in the workspace, but it wouldn’t run there. A LocalScript only runs if it’s in one of the five places specified on the wiki. (A descendant of either the backpack, a character, PlayerGui, PlayerScripts, or ReplicatedFirst)

2 Likes

Thank you so much, it was under the button, I’ve changed my script 1000x. I knew this but I didn’t at the same time if you know what I mean. Silly me!