I have script that creates a folder name's it leaderstats and a value named gold. I want it so when you stand in a certain area it'll add 40 gold every minute.
This is all I got to but i'm clueless and not good at all at scripting
local Gold = game.Players.leaderstats.Gold
function onTouched(hit)
while true do
wait(60)
Gold.Value = Gold.Value + 40
end
end

5 comments
You've got options with this. You can either use region3 or magnitude. If you wanted you just use touched event with a touch ended event, but it is very sensitive, and would most likely fail
What's the difference between region3 and magnitude?
Magnitude checks if your character is in a certain range of a brick, and region3 checks if you are inside of a designated region that you set up via script. For magnitude you would have to have a part and check if the character is close enough to that part to get points
I would want to use magnitude then, but how would I utilize this in my script?
Anyone at all that can help please?