function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2328 and getPlayerLevel(cid) >= 300 then
doPlayerAddExperience(cid, 1)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) <= 150 then
doPlayerAddExperience(cid, 200000)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) >=150 and not getPlayerLevel (cid) >= 300 then
doPlayerAddExperience(cid, 100000)
doRemoveItem(item.uid, 1)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2328 and getPlayerLevel(cid) >= 300 then
doPlayerAddExperience(cid, 1)
doRemoveItem(item.uid, 1)
doCreatureSay(cid, "1EXP", TALKTYPE_BLUE_1)
elseif item.itemid == 2328 and getPlayerLevel (cid) <= 150 then
doPlayerAddExperience(cid, 200000)
doRemoveItem(item.uid, 1)
doCreatureSay(cid, "200000EXP", TALKTYPE_BLUE_1)
elseif item.itemid == 2328 and getPlayerLevel (cid) >=150 and not getPlayerLevel (cid) >= 300 then
doPlayerAddExperience(cid, 100000)
doRemoveItem(item.uid, 1)
doCreatureSay(cid, "100000EXP", TALKTYPE_BLUE_1)
end
return true
end
[19/02/2013 14:20:14] [Error - Action Interface]
[19/02/2013 14:20:14] data/actions/scripts/expegg.lua:onUse
[19/02/2013 14:20:14] Description:
[19/02/2013 14:20:14] data/actions/scripts/expegg.lua:12: attempt to compare number with boolean
[19/02/2013 14:20:14] stack traceback:
[19/02/2013 14:20:14] data/actions/scripts/expegg.lua:12: in function <data/actions/scripts/expegg.lua:1>
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2328 and getPlayerLevel(cid) >= 300 then
doPlayerAddExperience(cid, 1)
doCreatureSay(cid, "You gaind 1 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "1", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) <= 150 then
doPlayerAddExperience(cid, 100000)
doSendMagicEffect(getPlayerPosition(cid),28)
doCreatureSay(cid, "You gaind 100000 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "100000", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) >=150 and not getPlayerLevel (cid) >= 300 then
doPlayerAddExperience(cid, 50000)
doSendMagicEffect(getPlayerPosition(cid),28)
doCreatureSay(cid, "You gaind 50000 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "50000", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
end
return true
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if item.itemid == 2328 and getPlayerLevel(cid) >= 300 then
doPlayerAddExperience(cid, 1)
doCreatureSay(cid, "You gaind 1 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "1", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) <= 150 then
doPlayerAddExperience(cid, 100000)
doSendMagicEffect(getPlayerPosition(cid),28)
doCreatureSay(cid, "You gaind 100000 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "100000", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
elseif item.itemid == 2328 and getPlayerLevel (cid) >=151 and getPlayerLevel (cid) < 300 then
doPlayerAddExperience(cid, 50000)
doSendMagicEffect(getPlayerPosition(cid),28)
doCreatureSay(cid, "You gaind 50000 experience", TALKTYPE_ORANGE_1)
doSendAnimatedText(getPlayerPosition(cid), "50000", TEXTCOLOR_WHITE)
doRemoveItem(item.uid, 1)
end
return true
end