• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Prevent shield equip while using 2 handed weapon

ralke

(҂ ͠❛ ෴ ͡❛)ᕤ
Joined
Dec 17, 2011
Messages
1,521
Solutions
27
Reaction score
870
Location
Santiago - Chile
GitHub
ralke23
Twitch
ralke23
Hi there! I need something very specific for a system I have, i'm looking for a way to prevent the equip of a shield if you're using a two-handed weapon. It should not equip, it should cancel with 'drop two handed first'.. I'm using TFS 1.5 downgrades 8.6, where in the sources/.lua files the server removes the two-handed weapon first and automatically drag it to the backpack when a shield is equiped? And which code I have to implement to achieve what I need?

It is very important that the two-handed weapon is not automatically moved to the backpack; instead it should be "dragged" with the mouse to trigger the deEquip function. Here's an attached video of what is specifically my problem.


I'll also attach related information to what I need, if someone knows better what to do
Issue with "drop the two-handed" · Issue #2101 · otland/forgottenserver (https://github.com/otland/forgottenserver/issues/2101)
Check two-handed weapons on equip by cezarguimaraes · Pull Request #1688 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/1688/files)

Thanks in advance!
Post automatically merged:

Solved commenting line 89 to 144 here, just add -- [[ and close with ]].

I still need to test it a little more but seems to work! ^^
 
Last edited:
Hi there! I need something very specific for a system I have, i'm looking for a way to prevent the equip of a shield if you're using a two-handed weapon. It should not equip, it should cancel with 'drop two handed first'.. I'm using TFS 1.5 downgrades 8.6, where in the sources/.lua files the server removes the two-handed weapon first and automatically drag it to the backpack when a shield is equiped? And which code I have to implement to achieve what I need?

It is very important that the two-handed weapon is not automatically moved to the backpack; instead it should be "dragged" with the mouse to trigger the deEquip function. Here's an attached video of what is specifically my problem.


I'll also attach related information to what I need, if someone knows better what to do
Issue with "drop the two-handed" · Issue #2101 · otland/forgottenserver (https://github.com/otland/forgottenserver/issues/2101)
Check two-handed weapons on equip by cezarguimaraes · Pull Request #1688 · otland/forgottenserver (https://github.com/otland/forgottenserver/pull/1688/files)

Thanks in advance!
Post automatically merged:

Solved commenting line 89 to 144 here, just add -- [[ and close with ]].

I still need to test it a little more but seems to work! ^^
Happy to help ^^
 
Back
Top