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

Lua onEquip function

Use movements:
PHP:
    <movevent type="Equip" itemid="7891" slot="feet" level="35" event="function" value="onEquipItem">
        <vocation id="1"/>
        <vocation id="5" showInDescription="0"/>
        <vocation id="2"/>
        <vocation id="6" showInDescription="0"/>
    </movevent>
    <movevent type="DeEquip" itemid="7891" slot="feet" event="function" value="onDeEquipItem"/>

Slot can be:

PHP:
                    HEAD (1) = helmet
                    NECKLACE (2) = necklace slot (amulet of loss etc.)
                    BACKPACK (3) = backpack, bag
                    ARMOR (4) = armor
                    LEFT (5) = left hand (its really hand placed >> (right page on screen))
                    RIGHT (6) = right hand (its really hand placed << (left page on screen))
                    LEGS (7) = legs
                    FEET (8) = boots
                    RING (9) = ring slot
                    AMMO (10) = ammo slot (arrows etc.)
 
doesnt work for what i need because i want two vocations using sword weapon, but only one vocation can use two swords at same time

i'm trying to make something that check if player are using two swords and block targeting.. but gimme error :/

Code:
function onTarget(cid, target)
local v = getPlayerSlotItem(cid, 6)
if getPlayerVocation(cid) ~= 9 and getItemWeaponType(v.uid) == 1 then
return false
end
return true
end
Code:
[7/10/2013 12:37:55] [Error - CreatureScript Interface]
[7/10/2013 12:37:55] data/creaturescripts/scripts/dualWieldBlock.lua:onTarget
[7/10/2013 12:37:55] Description:
[7/10/2013 12:37:55] (LuaInterface::luaGetThing) Thing not found
 
Last edited:
Back
Top