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

OTClient How do I check if an equipped item is weapon?

Togu

Advanced OT User
Joined
Jun 22, 2018
Messages
308
Solutions
1
Reaction score
178
Location
Brazil
Lua:
  local weaponLeft = localPlayer:getInventoryItem(InventorySlotLeft)
  local weaponRight = localPlayer:getInventoryItem(InventorySlotRight)
  if weaponLeft and weaponRight then
    speed = 200
  else
     speed = 100
  end
  setSkillBase('skillId'..id, localPlayer:getSkillLevel(id), baseLevel)
  setSkillValue('attackspeed', ((localPlayer:getSkillBaseLevel(4) - 8)/2 + speed) .. "%")

I need to check if weaponLeft and weaponRight are items with attack value (weapons).
 
Since all weapons have attack damage, I'd check for that.

In tfs 0.3.7 I'd use
Lua:
getItemInfo(itemid).attack

I'm sure tfs 1.3 has something identical or very similar.
 
Sorry, didn't realise you were trying to do some calculations with the client.
Honestly don't know anything about that.
I don't even know if the client is even capable of finding those attributes unless you specifically provide them to the client.

Someone more experienced then myself will have to help in this regard.
 
Back
Top