Friend if you can not understand what the boy wants, then do not say it's possible. because that is not true.You can do it with movements perfectly, you only need conditions.
what specific reason makes you need it through a script?
what's the point of a script mimicking a weapon being one handed instead of just making it one handed?
function onEquip(cid, item, slot)
if getPlayerSkill(cid, SKILL_SHIELD) >= 55 then
doItemSetAttribute(item.uid, '-----', true)
else
doItemSetAttribute(item.uid, '-----', false)
end
return true
end
function onDeEquip(cid, item, slot)
doItemSetAttribute(item.uid, '-----', true)
return true
end
ITEM_ATTRIBUTE_NONE
ITEM_ATTRIBUTE_ACTIONID
ITEM_ATTRIBUTE_UNIQUEID
ITEM_ATTRIBUTE_DESCRIPTION
ITEM_ATTRIBUTE_TEXT
ITEM_ATTRIBUTE_DATE
ITEM_ATTRIBUTE_WRITER
ITEM_ATTRIBUTE_NAME
ITEM_ATTRIBUTE_ARTICLE
ITEM_ATTRIBUTE_PLURALNAME
ITEM_ATTRIBUTE_WEIGHT
ITEM_ATTRIBUTE_ATTACK
ITEM_ATTRIBUTE_DEFENSE
ITEM_ATTRIBUTE_EXTRADEFENSE
ITEM_ATTRIBUTE_ARMOR
ITEM_ATTRIBUTE_HITCHANCE
ITEM_ATTRIBUTE_SHOOTRANGE
ITEM_ATTRIBUTE_OWNER
ITEM_ATTRIBUTE_DURATION
ITEM_ATTRIBUTE_DECAYSTATE
ITEM_ATTRIBUTE_CORPSEOWNER
ITEM_ATTRIBUTE_CHARGES
ITEM_ATTRIBUTE_FLUIDTYPE
ITEM_ATTRIBUTE_DOORID
If player:getStorageValue(storage) == 1 or player:getVocation() == vocation then
return true -- This means that you will be able to equip the weapon normally if you have the storage or the correct vocation.
else
if player:getSlotItem(CONST_SLOT_LEFT) or player:getSlotItem(CONST_SLOT_RIGHT) then --- if the player doesnt have the storage, and already has one of the hands busy, it wont be able to equip. Meaning it will work as a two-handed.
player:sendCancelMessage('You need both hands free to equip this.')
else
return true
end
end
function onEquip(cid, item, slot)
if getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55 then
return true
elseif (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 0 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 2393) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2393 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 0) then
return true
elseif (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid ~= 0 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid == 2393) or (getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid == 2393 and getPlayerSlotItem(cid,CONST_SLOT_RIGHT).itemid ~= 0) then
doPlayerSendCancel(cid, 'You need both hands free to equip this.')
end
return true
end
if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then
weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then
weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55 then
return true
else
if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then
doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this')
return false
end
if weapon ~= 2392 then
doPlayerSendCancel(cid, 'You need both hands free to equip this.')
return false
end
end
wtf.. you are messing things up and its not needed.
Code:if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55 then return true else if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this') return false end if weapon ~= 2392 then doPlayerSendCancel(cid, 'You need both hands free to equip this.') return false end end
[LIST=1]
[*]if weapon ~= 2393 then
[*] doPlayerSendCancel(cid, 'You need both hands free to equip this.')
[*] return false
[*] end
[/LIST]
Are you soure you updated the script? With return false, you should not be able to equip and itemI havent got error, only when i equip the weapon, return the sendcancel but i can continue to equip the weapon. All script found but this part of script
Lua:[LIST=1] [*]if weapon ~= 2393 then [*] doPlayerSendCancel(cid, 'You need both hands free to equip this.') [*] return false [*] end [/LIST]
Dont work, because when i equip the weapon, return the send cancel but i can continue to equip the weapon and shouldnt equip weapon
function onEquip(cid, item, slot)
if getPlayerSlotItem(cid, CONST_SLOT_LEFT) then
weapon = getPlayerSlotItem(cid, CONST_SLOT_LEFT).itemid
elseif getPlayerSlotItem(cid, CONST_SLOT_RIGHT) then
weapon = getPlayerSlotItem(cid, CONST_SLOT_RIGHT).itemid
elseif weapon == 2392 and getPlayerSkillLevel(cid, SKILL_SHIELD) >= 55 then
return true
else
if getPlayerSkillLevel(cid, SKILL_SHIELD) < 55 then
doPlayerSendCancel(cid, 'You need 55 shielding skill to equip this')
return false
end
if weapon ~= 2392 then
doPlayerSendCancel(cid, 'You need both hands free to equip this.')
return false
end
return true
end