Skip to content

Commit

Permalink
Update Refil Ammo.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Ascerr committed Apr 7, 2019
1 parent 60554d7 commit 6facc58
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions Refil Ammo.lua
@@ -1,22 +1,31 @@
--[[
Script Name: Refil Ammo
Description: Refile ammuntion to your arrow slot when amount drop down.
Description: Refile ammuntion to your arrow slot or hand when amount drop down.
Author: Ascer - example
]]

local AMMO = {
id = 3447, -- ammo id
amount = 90 -- when amount drop down to .. value restore.
id = 2667, -- ammo id
amount = 50, -- when amount drop down to .. value restore.
slot = SLOT_WEAPON -- where we should put new part of ammo. SLOT_SHIELD, SLOT_WEAPON, SLOT_AMMO
}

-- DON'T EDIT BELOW THIS LINE

local arrow

Module.New("Refil Ammo", function (mod)
local arrow = Self.Ammo()
if AMMO.slot == SLOT_WEAPON then
arrow = Self.Weapon()
elseif AMMO.slot == SLOT_SHIELD then
arrow = Self.Shield()
else
arrow = Self.Ammo()
end
if arrow.id ~= AMMO.id or arrow.count <= AMMO.amount then -- check for different id or low amount
local item = Container.FindItem(AMMO.id) -- find item
if item ~= false then
Container.MoveItemToEquipment(item.index, item.slot, SLOT_AMMO, item.id, item.count) -- shove to ammo slot
Container.MoveItemToEquipment(item.index, item.slot, AMMO.slot, item.id, item.count) -- shove to ammo slot
end
end
mod:Delay(800, 1500)
Expand Down

0 comments on commit 6facc58

Please sign in to comment.