Page 1 of 1

How to you set interviles in minetest modding?

PostPosted: Tue Mar 13, 2012 04:25
by bob
How to you set times to wait in minetest modding? like i want an apple on eat be -1 every second second. so when you eat the item it just keeps -1 off your health every second second till you die how do you do this?

PostPosted: Tue Mar 13, 2012 06:29
by sfan5
You can't set Timers

PostPosted: Tue Mar 13, 2012 11:23
by jordan4ibanez
os.time()?

PostPosted: Tue Mar 13, 2012 11:34
by kahrl
I think your only chance is register_on_globalstep, which might be a little inefficient. But it works.

PostPosted: Tue Mar 13, 2012 15:48
by xyz
Here: http://minetest.ru/wiki/script_api:register_globalstep (sorry for Russian, but it has code sample)