local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.RemoteEvent
local Button = script.Parent
local Amount = 100 -- Change if you want
Button.MouseButton1Click:Connect(function()
Event:FireServer(Amount)
end)
Script inside ServerScriptService
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Event = ReplicatedStorage.RemoteEvent
Event.OnServerEvent:Connect(function(Plr, Amount)
Plr.leaderstats.Money.Value = Amount
end)
You would need to use remote events to send the information that you have clicked a button from a client and then that information will pass through the remote event and be sent to the server, so you can do any changes in the server script.