Serginov
Onkonkoronkonk
HELLO!!
Here's my exp scroll, easy to configure
Hotfix by Sync:
Me is pro!
Here's my exp scroll, easy to configure

LUA:
function onUse(cid, item, frompos, item2, topos)
-- Item ID
local ExpScroll = 6119
-- Storage Value
local ExpStorage = 99997
-- How much experience will be given?
local ExpAmount = 12500000
-- How many times may a player use this scroll?
local ExpTimes = 2
-- Magic effect when true
local TrueMagicEffect = CONST_ME_MAGIC_RED
-- Magic effect when used "ExpTimes" times
local FalseMagicEffect = CONST_ME_POFF
-- Level when not able to use
local LevelLimit = 200
if item.itemid == ExpScroll then
if getPlayerLevel(cid) <= LevelLimit then
if getPlayerStorageValue(cid, ExpStorage) ~= (ExpTimes-1) then
doPlayerAddExperience(cid, ExpAmount)
doSendMagicEffect(frompos, TrueMagicEffect)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, ExpStorage, (getPlayerStorageValue(cid, ExpStorage)+1))
else
doPlayerSendCancel(cid, "Either your level is above " .. LevelLimit .. " or you have already used this scroll " .. ExpTimes .. " times!")
doSendMagicEffect(frompos, FalseMagicEffect)
end
end
end
return TRUE
end
Hotfix by Sync:
LUA:
function onUse(cid, item, frompos, item2, topos)
local c = {
ExpScroll = 6119, -- Item ID
ExpStorage = 99997, -- Storage Value
ExpAmount = 12500000, -- How much experience will be given?
ExpTimes = 2, -- How many times may a player use this scroll?
TrueMagicEffect = CONST_ME_MAGIC_RED, -- What magic effect should be made when it work?
FalseMagicEffect = CONST_ME_POFF, -- What magic effect should be made when it doesn't work?
LevelLimit = 200 -- Which level are you not allowed to use it?
}
if item.itemid == c.ExpScroll then
if getPlayerLevel(cid) <= c.LevelLimit then
if getPlayerStorageValue(cid, c.ExpStorage) ~= (c.ExpTimes-1) then
doPlayerAddExperience(cid, c.ExpAmount)
doSendMagicEffect(frompos, c.TrueMagicEffect)
doRemoveItem(item.uid, 1)
setPlayerStorageValue(cid, c.ExpStorage, (getPlayerStorageValue(cid, c.ExpStorage)+1))
else
doPlayerSendCancel(cid, "You have already used this scroll " .. c.ExpTimes .. " times!")
doSendMagicEffect(frompos, c.FalseMagicEffect)
end
end
end
return TRUE
end
Me is pro!
Last edited: