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

Add skill or magic level requirement to weapons/armors

skdlamaza

New Member
Joined
Jun 18, 2013
Messages
15
Reaction score
2
Hey everyone,

I get in to my server after some years and I was making changes with some friends and we didn't find a way to add a skill requeriment for equipments...

For example we want to do something like : Focus Cape (Magic level to use: 10)
Magic Sword (Sword Fighting to use: 80)

I'm using TFS 1.2,
 
You will have to use onEquip script, Something like this.
Example:
Lua:
--[[
SKILL_FIST
SKILL_CLUB
SKILL_SWORD
SKILL_AXE
SKILL_DISTANCE
SKILL_SHIELD
SKILL_FISHING
SKILL_MAGLEVEL
SKILL_LEVEL
]]

local requiredSkillLevel = 100

function onEquip(player, item, slot)
    if player:getSkillLevel(SKILL_SWORD) >= requiredSkillLevel then
        player:sendCancelMessage("You can equip this item.")
        return true
    end
    player:sendCancelMessage("You cannot equip this item yet.")
    return false
end
 
Back
Top