-- Wibben 2010
function onUse(cid, item, fromPosition, itemEx, toPosition)
doCreatureSay(cid, "You've been awarded 5000 exp :).", TALKTYPE_ORANGE_1)
doPlayerAddExp(cid,5000)
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
end
end
<action itemid="6544" script="exp.lua"/>
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
max = 100, -- Max Level
exp = 5000,
remove = "yes" -- "yes" or "no"
}
cfg.remove = getBooleanFromString(cfg.remove)
if getPlayerLevel(cid) < cfg.max then
if cfg.remove then
doRemoveItem(item.uid, 1)
return true
end
else
doPlayerSendCancel(cid, "Sorry, not possible.")
end
return doPlayerAddExperience(cid, cfg.exp) and doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)
end
stop take my shitCode:function onUse(cid, item, fromPosition, itemEx, toPosition) local cfg = { max = 100, -- Max Level exp = 5000, remove = "yes" -- "yes" or "no" } [B][COLOR="Red"]cfg.remove = getBooleanFromString(cfg.remove)[/COLOR][/B] if getPlayerLevel(cid) < cfg.max then if cfg.remove then doRemoveItem(item.uid, 1) return true end else doPlayerSendCancel(cid, "Sorry, not possible.") end return doPlayerAddExperience(cid, cfg.exp) and doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS) end