• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

Weapon type

ConAn Edujawa

Member
Joined
Feb 23, 2015
Messages
457
Reaction score
17
  1. hello guys i found this function here and need to use it for change weapon type but i don't know how if anyone can help me im use 0.4
this function
Code:
function getPlayerWeaponType(cid)
    local weapon = getPlayerWeapon(cid, true)
    if weapon and weapon.uid > 0 then
        return getItemWeaponType(weapon.uid)
    end
    return WEAPON_NONE
end
-- use this in your code
if getPlayerWeaponType(cid) == WEAPON_SWORD then
   -- your code here
end

i need to use it like this
if getPlayerWeaponType(cid) == WEAPON_SWORD then
doTransformWeaponType(cid, WEAPON_AXE)
 
Solution
you can't change weapon type, it's defined in items.xml
there's no functions to change it because it's a static attribute
just like how you cant change absorb percent
your best bet is to change the item, not the weapon type
how does it even make sense to change a sword to have an axe weapon type?
you can't change weapon type, it's defined in items.xml
there's no functions to change it because it's a static attribute
just like how you cant change absorb percent
your best bet is to change the item, not the weapon type
how does it even make sense to change a sword to have an axe weapon type?
 
Solution
you can't change weapon type, it's defined in items.xml
there's no functions to change it because it's a static attribute
just like how you cant change absorb percent
your best bet is to change the item, not the weapon type
how does it even make sense to change a sword to have an axe weapon type?
im use custom client i need one weapon = all types and player can choose what he want
 
custom client doesnt matter in this case it's a script problem
if you want a weapon to be all types you need to source edit a new weapon type and make skill tries happen for all skills instead of one that the weapon type is
 
custom client doesnt matter in this case it's a script problem
if you want a weapon to be all types you need to source edit a new weapon type and make skill tries happen for all skills instead of one that the weapon type is
bro i need when i have weapon type axe and when click on it change to weapon type sword
 
if you have a custom client just create multiple of the same item with different ids and weapon types but same sprite
use an action script to switch items
 

Similar threads

Back
Top