mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-27 11:35:22 +09:00
.
This commit is contained in:
@@ -13,11 +13,16 @@ Commands.new("waterfill", { "exp-commands_waterfill.description" })
|
|||||||
if Selection.is_selecting(player, SelectionName) then
|
if Selection.is_selecting(player, SelectionName) then
|
||||||
Selection.stop(player)
|
Selection.stop(player)
|
||||||
return Commands.status.success{ "exp-commands_waterfill.exit" }
|
return Commands.status.success{ "exp-commands_waterfill.exit" }
|
||||||
elseif player.get_item_count("cliff-explosives") == 0 then
|
|
||||||
return Commands.status.error{ "exp-commands_waterfill.requires-explosives" }
|
|
||||||
else
|
else
|
||||||
Selection.start(player, SelectionName)
|
local item_count_cliff = player.get_item_count("cliff-explosives")
|
||||||
return Commands.status.success{ "exp-commands_waterfill.enter" }
|
local item_count_craft = math.min(math.floor(player.get_item_count("explosives") / 10), player.get_item_count("barrel"), player.get_item_count("grenade"))
|
||||||
|
local item_count_total = item_count_cliff + item_count_craft
|
||||||
|
if item_count_total == 0 then
|
||||||
|
return player.print{ "exp-commands_waterfill.requires-explosives" }
|
||||||
|
else
|
||||||
|
Selection.start(player, SelectionWaterfillArea)
|
||||||
|
return player.print{ "exp-commands_waterfill.enter" }
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user