minetest.register_globalstep

From Minetest Developer Wiki
Jump to: navigation, search

Syntax

Description

  • dtime — float, time since the last global step.

Called every server step, usually interval of 0.05s.

Example 1

local timer = 0
minetest.register_globalstep(function(dtime)
	timer = timer + dtime;
	if timer >= 5 then
		-- Send "Minetest" to all players every 5 seconds
		minetest.chat_send_all("Minetest")
		timer = 0
	end
end)
Personal tools
Namespaces

Variants
Actions
Navigation
API
Toolbox