ID:155755
 
Hi all. I'm wondering if anyone could help me with this. I want to create a system where the player would recieve 1 gold per second of server time. So as time goes by, the mob is steadily getting gold.

Please could someone help and verify a way to do this?

Edit: This is a bad example, but what I'm really tryin to do is create a "farm" where it would gain wheat every second and when the user harvests the farm, the wheat of the farm is set to 0 and it starts again. The wheat then gets stored into "storage". Here is all I got so far

obj
farm
icon = 'icon.dmi'
icon_state = "farm"
var/wheat = 10
Click()
switch(alert("would you like to harvest your field?",,"Yes","No"))
if("Yes")
usr << "You have harvested your field"
..........
if("No")
usr << "You choose not to harvest"
The easiest way I can think of to do this would be to use a world.realtime. Set a variable for the wheat that keeps track of the last time it was harvested. Then when the player goes to harvest again, you can compare that previous realtime to the current realtime. The difference in times would give you that measurement you are looking for. Then you just set the last harvest time to the current time once again, and the process repeats every time they harvest.
In response to Gunbuddy13
That makes sense. Thanks