function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1302) == 2 then
doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 8 then
doCreatureSay(cid, "You Gained 40 000 000 Experience Points!", TALKTYPE_ORANGE_1)
doPlayerAddExp(cid, [B][COLOR="Red"]JUST CHANGE THE EXP YOU WANT TO ADD HERE[/COLOR][/B])
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1302,0)
return TRUE
else
doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
end
end
end
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1302) == 2 then
doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 8 then
doCreatureSay(cid, "You Gained 1000 Experience Points!", TALKTYPE_ORANGE_1)
doPlayerAddExp(cid, [B][COLOR="Red"]JUST CHANGE THE EXP YOU WANT TO ADD HERE[/COLOR][/B])
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
setPlayerStorageValue(cid,1302,0)
return TRUE
else
doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
end
end
end
<action itemid="[B][COLOR="Red"]ITEM YOU WANT TO GIVE THE EXP[/COLOR][/B]" script="quests/exp scroll[COLOR="Red"][B]2[/B][/COLOR].lua"/>
why storage value?
I want players being able to use them all the time.....and I want to make them all in 1 script not making 100000 of scripts
![]()
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerStorageValue(cid,1302) == 2 then
doCreatureSay(cid, "You can only use this scroll once!", TALKTYPE_ORANGE_1)
else if getPlayerLevel(cid) >= 8 then
doCreatureSay(cid, "You Gained 1000 Experience Points!", TALKTYPE_ORANGE_1)
doPlayerAddExp(cid, JUST CHANGE THE EXP YOU WANT TO ADD HERE)
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
[SIZE="4"][COLOR="Red"][B]setPlayerStorageValue(cid,1302,0)[/B][/COLOR][/SIZE]
return TRUE
else
doCreatureSay(cid, "You must be over level 8 to use this scroll", TALKTYPE_ORANGE_1)
end
end
end
Code:function onUse(cid, item, fromPosition, itemEx, toPosition) local cfg = { [XXXX] = { level = 10, exp = 10000 }, [XXXX] = { level = 10, exp = 10000 } } if(getPlayerLevel(cid) >= cfg[item.itemid].level) then doCreatureSay(cid, "You recieved " .. cfg[item.itemid].exp .. " experience.") doPlayerAddExperience(cid, cfg[item.itemid].exp) doRemoveItem(item.uid) else doPlayerSendCancel(cid, "Your level is not high enough.") end return true end
function onUse(cid, item, fromPosition, itemEx, toPosition)
local cfg = {
[XXXX] = { level = 10, exp = 10000 },
[XXXX] = { level = 10, exp = 10000 }
}
if(getPlayerLevel(cid) >= cfg[item.itemid].level) then
doCreatureSay(cid, "You recieved " .. cfg[item.itemid].exp .. " experience.", TALKTYPE_ORANGE_1)
doPlayerAddExperience(cid, cfg[item.itemid].exp)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "Your level is not high enough.")
end
return true
end