local Player = game.Players.LocalPlayer

local Stats = Player:WaitForChild("leaderstats")

local OoferBucks = Stats:WaitForChild("OoferBucks")

local UI = script.Parent -- UI is the ScreenGui

local Button = UI:WaitForChild(OofButton,10)

local Debounce = false -- this prevent from spamming the button!

Button.MouseButton1Click:Connect(function()

if Debounce == false then

Debounce = true

OoferBucks.Value = OoferBucks.Value + 1

wait(2) -- this is the amount of secounds you should wait before getting more money!

Debounce = false

end

end)

I've been trying to get this script to work for over an hour and it just isn't working. It says that local Button = UI:WaitForChild(OofButton,10) is incorrect and I've been trying to fix it but it isn't working. Please help.

2 comments

0

You forgot to include the String-cap syntax.

0

Is it a Text Button You Are Using Or Text Lebel ??