MineClonXX/mods/command/time.lua

29 lines
613 B
Lua
Raw Normal View History

2015-06-29 19:55:56 +02:00
minetest.register_chatcommand("night", {
params = "",
description = "Make the night",
privs = {settime = true},
func = function(name, param)
2015-07-04 04:56:02 +02:00
local player = minetest.get_player_by_name(name)
2015-06-29 19:55:56 +02:00
if not player then
return
end
2015-07-04 04:56:02 +02:00
minetest.set_timeofday(0.22)
2015-06-29 19:55:56 +02:00
end
})
minetest.register_chatcommand("day", {
params = "",
description = "Make the day wakeup",
privs = {settime = true},
func = function(name, param)
2015-07-04 04:56:02 +02:00
local player = minetest.get_player_by_name(name)
2015-06-29 19:55:56 +02:00
if not player then
return
end
2015-07-04 04:56:02 +02:00
minetest.set_timeofday(0.6)
2015-06-29 19:55:56 +02:00
end
})