Create init.lua

This commit is contained in:
zmv7 2022-02-03 23:33:51 +05:00 committed by GitHub
commit 4afcea6b45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

10
init.lua Normal file
View File

@ -0,0 +1,10 @@
minetest.register_chatcommand("m", {
params = "[<set>]",
description = "Open megastorage",
func = function(param)
core.show_formspec('ec','size[32.5,21]scroll_container[0,0;42,19;;vertical;0.4]list[current_player;mega;0,0;32,64]listring[current_player;mega]scroll_container_end[]list[current_player;main;12,17;8,4]listring[current_player;main]label[29,18.2;Trash:]list[detached:trash;main;30,18;1,1]scrollbaroptions[max=142;thumbsize=50]scrollbar[32,0;0.5,16;vertical;;0]')
if param == "set" then
core.run_server_chatcommand('/lua','minetest.get_player_by_name("'..core.localplayer:get_name()..'"):get_inventory():set_size("mega", 64*32)')
end
end,
})