so im wanting to add a simple "finish" system in my game and im very noob at Lua, just started using it a few days ago :P
so i figured an easy way to do a fishing system would be have a brick in the water, they click it and it does an animation which im not worried about atm and every little bit it adds gold to their gold.
i thought this would be easy for me to add but i guess not, this is what i came up with, and like i said i JUST started Lua so dont be mean if this is a stupid attempt at writing this out
Leaderstats = game.Players.Player:FindFirstChild("Leaderstats")
local Enabled = false
function onClicked()
if Enabled == false then
Enabled = true
end
if Enabled == true then
Leaderstats.Gold.Value = Leaderstats.Gold.Value + 10
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
i guess my question is, how do i change this to actually add gold to my leaderstats when i click the brick, i can figure out how to have to repeat giving gold every little bit. THANKS in advance :)

2 comments
Enabled value is useless as you're setting it to be always true anyway
thanks for clearing that up :p, saw other scripts similar to this use it so i thought it was something you do >>