Skip to content

Commit

Permalink
Update toolgear.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
Jonyrewind authored Feb 10, 2024
1 parent 6aeed19 commit 9b9e767
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions data-otservbr-global/scripts/actions/tools/toolgear.lua
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
local toolGear = Action()

function toolGear.onUse(player, item, fromPosition, target, toPosition, isHotkey)
return onUseRope(player, item, fromPosition, target, toPosition, isHotkey)
or onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
or onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
or onUseMachete(player, item, fromPosition, target, toPosition, isHotkey)
or onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey)
or onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey)
or onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
or onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey)
if math.random(100) > 5 then
return onUseRope(player, item, fromPosition, target, toPosition, isHotkey)
or onUseShovel(player, item, fromPosition, target, toPosition, isHotkey)
or onUsePick(player, item, fromPosition, target, toPosition, isHotkey)
or onUseMachete(player, item, fromPosition, target, toPosition, isHotkey)
or onUseCrowbar(player, item, fromPosition, target, toPosition, isHotkey)
or onUseSpoon(player, item, fromPosition, target, toPosition, isHotkey)
or onUseScythe(player, item, fromPosition, target, toPosition, isHotkey)
or onUseKitchenKnife(player, item, fromPosition, target, toPosition, isHotkey)
else
player:say("Oh no! Your tool is jammed and can't be used for a minute.", TALKTYPE_MONSTER_SAY)
player:addAchievementProgress("Bad Timing", 10)
item:transform(item.itemid + 1)
item:decay()
end
return true
end

toolGear:id(9594, 9596, 9598)
Expand Down

0 comments on commit 9b9e767

Please sign in to comment.