I want my script to give me 1 cash when a press a text button. here is my local script in it
local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:FindFirstChild("ButtonClick") local button = script.Parent local debounce = false button.MouseButton1Click:Connect(function() if not debounce then debounce = true local playerpoint = game.Players.LocalPlayer.leaderstats.Points remote:FireServer(playerpoint) wait(0.01) debounce = false end end)
I have a event thing in replicated storage called button click. This is my script in workspace
local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:FindFirstChild("ButtonClick") remote.OnServerEvent:Connect(function(plr, x) x.Value = x.Value +1 end)
Please help me with this