so thanks for the user Ryzox i have a working script that gives gold when u click on a block....and im using it for a super simple fishing system, but im wanting it to repeat giving gold while you are holding click on the block if it makes sense.....
im very noob at lua so i have no clue how to do this. i know its probably going to use the While repeat but idk how to add that along with while mouse button is down or w/e and help would be appreciated :)
here is the script ive got
script.Parent.ClickDetector.MouseClick:connect(function(player)
local Leaderstats = player:findFirstChild("leaderstats")
if Leaderstats:findFirstChild("Gold") then
--Below needs to repeat while left mouse button is held down on the block
Leaderstats.Gold.Value = Leaderstats.Gold.Value + 10
--Above needs to repeat while left mouse button down on the block
end
end)

1 comment
omg ty so much, this is exactly what i was looking for :)