mirror of
https://git.minetest.land/VoxeLibre/VoxeLibre.git
synced 2024-11-22 10:31:06 +01:00
Enable fly in creative mode
This commit is contained in:
parent
4194a76db0
commit
0e15accada
1 changed files with 11 additions and 0 deletions
|
@ -3,3 +3,14 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||||
minetest.register_privilege("maphack", {
|
minetest.register_privilege("maphack", {
|
||||||
description = S("Can place and use advanced blocks like mob spawners, command blocks and barriers."),
|
description = S("Can place and use advanced blocks like mob spawners, command blocks and barriers."),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
minetest.register_on_joinplayer(function(player)
|
||||||
|
local name = user:get_player_name()
|
||||||
|
local fly = false
|
||||||
|
if minetest.is_creative_enabled(name) then
|
||||||
|
fly = true
|
||||||
|
end
|
||||||
|
minetest.set_player_privs(name, {
|
||||||
|
fly = fly,
|
||||||
|
})
|
||||||
|
end)
|
||||||
|
|
Loading…
Reference in a new issue