• 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!

How do I make an AMMO only usable on one weapon?

leokart7

New Member
Joined
Mar 19, 2015
Messages
46
Reaction score
0
Im trying to create "special items" and like I want that a certain ammo can only be used with one weapon and vice-versa. How can I make such thing?
TFS 0.3.6
 
I'm not really sure.. you could use a movement script to check ammo/weapon slot.. and if not correct/matching item..

Soo like

Put bow in hand.. if burst arrows in arrow slow, then deny action of putting bow in hand.

Otherwise it would require a source edit I think
 
Too much work ill just make them usable with everyhing hahaha thanks for the help thought! @Xikini
Well you could also use ~= .. which means negation of equality..
So if it's not equal to this then do something

Code:
If itemID in arrowslot ~= to 6034 then
return false
else
return true
or something.. idk. :p
 
You can do what Xikini posted so you won't be able add it in the arrow/hand slot.
Add the arrow to movements.xml with slot ammo and check in the Lua script for slot item of both hands or add the bow with slot hand and check for slot item in the ammo slot.
Code:
function onEquip(cid, item, slot)
     if .. then
          return true
     end
     return false
end
For arrow:
Code:
if getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid == x or getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == x then
Bow:
Code:
if getPlayerSlotItem(cid, CONST_SLOT_AMMO).itemid == x then
Instead of x the itemid.
You can also do it as a weapon script, then you can still add the ammo in the slot but simply not shoot with it when you don't use the right bow.
 
Last edited:
Back
Top