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

Is weapon/armor

Mock

Mock the bear (MTB)
Joined
Jul 29, 2008
Messages
619
Reaction score
106
Location
Brazil
Hello, i'm here to post 2 good functions :p
firts open the folder libs in data and open functions.lua and add it​

Code:
function isWeapon(uid)
 if getItemAttack(uid) > 0 and getItemArmor(uid) == 0 then
  return TRUE
  else
  return FALSE
 end
end
function isArmor(uid)
 if getItemAttack(uid) == 0 and getItemDefense(uid) == 0 and getItemArmor(uid) > 0 then
  return TRUE
  else
  return FALSE
 end
end
Save and have fun :p
 
Last edited:
PHP:
function isWeapon(uid)
	return (getItemAttack(uid) > 0) and TRUE or FALSE
end

function haveArmorPoints(uid)
	return (getItemAttack(uid) == 0 and getItemDefense(uid) == 0 and getItemArmor(uid) > 0) and TRUE or FALSE
end
Shortened
isArmor does not check that is armor only that is got armor points so i rename it.
 
Last edited:
Back
Top