hey, i have this addon lever script problem.. When a character uses the lever, it says they already have the addons when they don't :/
I dont get an error message for this script, it just doesnt function properly ingame:
I dont get an error message for this script, it just doesnt function properly ingame:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local v = getPlayerSex(cid) == 0 and 137 or 129
if not canPlayerWearOutfit(cid, v, 3) then
return doPlayerSendCancel(cid, "You have already obtained the hunter addons!")
end
if (getPlayerItemCount(cid, 5875) < 1) or (getPlayerItemCount (cid, 2804) < 100) then
return doPlayerSendCancel(cid, "You don't have sniper gloves or enough shadow herbs or sniper gloves to obtain this addon!")
end
doPlayerRemoveItem(cid, 5875, 1)
doPlayerRemoveItem(cid, 2804, 100)
doPlayerAddOutfit(cid, v, 3)
doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Congratulations, you've obtained the hunter addons!")
return true
end