+ Resetting the player's inventory when selecting a kit

master
Giov4 2020-11-05 15:28:17 +01:00
parent 16f88e7c7a
commit 217eb58f23
3 changed files with 8 additions and 6 deletions

View File

@ -5,14 +5,14 @@ Don't change the variables names if you don't know what you're doing!
(skywars_settings.variable_name = value)
]]
-- The table that stores all the global variables, don't touch this.
skywars_settings = {}
-- ARENA LIB'S SETTINGS --
-- The table that stores all the global variables, don't touch this.
skywars_settings = {}
-- Where players will be teleported when a match ends.
skywars_settings.hub_spawn_point = {x = 81, y = 25, z = 102}
@ -26,10 +26,10 @@ skywars_settings.queue_waiting_time = 10
-- The time between the end of the match and the respawn at the hub.
skywars_settings.celebration_time = 5
-- What's going to appear in most of the lines printed by murder.
-- What's going to appear in most of the lines printed by skywars.
skywars_settings.prefix = "Skywars > "
-- The players walking speed when ther're playing a match.
-- The players walking speed when they're playing a match.
skywars_settings.player_speed = 1.5
-- true = on/false = off (case sensitive).

View File

@ -4,7 +4,7 @@ local function treasure_to_itemstack() end
function skywars.reorder_treasures(arena)
-- sorting the table from the rarest to the least rare treasure
-- Sorting the table from the rarest to the least rare treasure.
for j = #arena.treasures, 2, -1 do
for i = 1, #arena.treasures-1 do
if arena.treasures[i].rarity < arena.treasures[i+1].rarity then

View File

@ -32,6 +32,8 @@ end)
function select_kit(pl_name, kit)
local player_inv = minetest.get_player_by_name(pl_name):get_inventory()
player_inv:set_list("main", {})
player_inv:set_list("craft", {})
for i=1, #kit.items do
player_inv:add_item("main", ItemStack(kit.items[i]))