+ Fixed the amount of items spawning in chests

+ Now removeitem removes all the item with that name
master
Giov4 2020-09-17 01:48:54 +02:00
parent c02ecc43b0
commit 329a240973
3 changed files with 5 additions and 6 deletions

View File

@ -124,4 +124,4 @@ arena_lib.on_timeout("skywars", function(arena)
arena_lib.load_celebration("skywars", arena, skywars.T("Nobody"))
arena_lib.send_message_players_in_arena(arena, skywars_settings.prefix .. skywars.T("Time is out, the match is over!"))
end)
end)

View File

@ -34,8 +34,7 @@ function skywars.select_random_treasures(treasure_amount, min_preciousness, max_
end
if treasure_amount == nil or treasure_amount == 0 then treasure_amount = 1 end
-- sorting the table from the rarest to the least rare treasure, so that if one of them has rarity one
-- and it's at index one it doesn't prevent other treasures from appearing
-- 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
@ -84,6 +83,7 @@ function skywars.select_random_treasures(treasure_amount, min_preciousness, max_
-- if the random number is a multiple of the item rarity then select it
if random % p_treasures[t].rarity == 0 then
table.insert(treasures, p_treasures[t])
break
end
end
end

View File

@ -612,12 +612,11 @@ function(cmd)
for i=1, #kits[kit_name].items do
if kits[kit_name].items[i].name == item_name then
table.remove(kits[kit_name].items, i)
skywars.overwrite_kits(kits)
found = true
break
end
end
skywars.overwrite_kits(kits)
if found then
skywars.print_msg(sender, skywars.T("@1 removed from @2!!", item_name, kit_name))
else