• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua help with Exp scroll

Zatacka

Mapper, Basic Scripter
Joined
May 12, 2009
Messages
222
Reaction score
14
Location
Sweden
hi can someone edit this script so it wont make me lvl 1 when i use it many times? its for a highexp server.


what happens
lvl 500000 ----> use exp scroll -----> lvl 1 -----> use exp scroll -----> 300001....................and so on

what i want to happen
lvl 500000 ----> use exp scroll -----> lvl 717217 ----> cant use anymore.

ohh, it also gives players debug!




HTML:
local cfg = {
    amount = 300000 -- here how many levels you want
	  }
	function onUse(cid, item, fromPosition, itemEx, toPosition)
	doPlayerAddLevel(cid, cfg.amount)
	doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 300k Levels!. ", TALKTYPE_ORANGE_1)
	doSendMagicEffect(getCreaturePosition(cid), 28)
	doRemoveItem(item.uid,1)
	return TRUE
	end
 
Last edited:
take bro , don't forget to Rep++ XD
Lua:
local cfg = {
        amount = 300000 -- here how many levels you want
              }
            function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerLevel(cid) < 717217 then
            doPlayerAddLevel(cid, cfg.amount)
            doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 300k Levels!. ", TALKTYPE_ORANGE_1)
            doSendMagicEffect(getCreaturePosition(cid), 28)
            doRemoveItem(item.uid,1)
            else
            doPlayerSendCancel(cid,"You no can used this if you are level 717217.")
            end
            return TRUE
            end

- - - Updated - - -

anymore problem , post here :S

- - - Updated - - -

anymore problem , post here :S
 
Lua:
local cfg = {
    amount = 600000 -- here how many levels you want
	  }
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if (getPlayerLevel(cid) + cfg.amount) > 717216 then
		local levelCap = (717216 - getPlayerLevel(cid))
		doPlayerAddLevel(cid, levelCap)
		doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced " .. levelCap .. " Levels!. ", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), 28)
		doRemoveItem(item.uid,1)
	else
		doPlayerAddLevel(cid, cfg.amount)
		doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 600000 Levels!. ", TALKTYPE_ORANGE_1)
		doSendMagicEffect(getCreaturePosition(cid), 28)
		doRemoveItem(item.uid,1)
	end
	return TRUE
end
 
No it's not, look at your script, it's not checking whether you'll pass 717217 or not.
For example, let's do a quick walkthrough with your script.

What if your level is 717000.
Lua:
if getPlayerLevel(cid) < 717217 then
717000 < 717217? PASS.
doPlayerAddLevel(cid, cfg.amount)

717000 + 300000 = 1 WOOPS

Now, look at my script.

What if your level is 717000.
Lua:
if (getPlayerLevel(cid) + cfg.amount) > 717216 then
717000 + 300000 = 1017000 > 717216 = PASS
Lua:
local levelCap = (717216 - getPlayerLevel(cid))
		doPlayerAddLevel(cid, levelCap)
717216 - 717000 = 216
Add 216 levels to reach 717216.
 
Evans scripter was more correct but i think there is something missing or something must be changed with evans script too
 
this one should be work :S + i tested it and works fine
Lua:
local cfg = {
        amount = 300000 -- here how many levels you want
              }
            function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerLevel(cid) < 717217 then
            doPlayerAddLevel(cid, cfg.amount)
            doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 300k Levels!. ", TALKTYPE_ORANGE_1)
            doRemoveItem(item.uid,1)
            else
            doPlayerSendCancel(cid,"You no can used this if you are level 717217.")
            end
            return TRUE
            end
 
this one should be work :S + i tested it and works fine
Lua:
local cfg = {
        amount = 300000 -- here how many levels you want
              }
            function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerLevel(cid) < 717217 then
            doPlayerAddLevel(cid, cfg.amount)
            doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 300k Levels!. ", TALKTYPE_ORANGE_1)
            doRemoveItem(item.uid,1)
            else
            doPlayerSendCancel(cid,"You no can used this if you are level 717217.")
            end
            return TRUE
            end

Lol, you suck if these are your scripts. You are just embarrassing yourself. You can't even tab or correct your own script...

Try this:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local level = 300000
	if((getPlayerLevel(cid) + level) < 717217) then
		doPlayerAddLevel(cid, level)
	else
		local level = (717216 - getPlayerLevel(cid))
		doPlayerAddLevel(cid, level)
	end
	
	doRemoveItem(item.uid, 1)
	doSendMagicEffect(getCreaturePosition(cid), 12)
	doPlayerSendTextMessage(cid, 19, "You have advanced ".. level .." level".. (level > 0 and "s" or "") .."!")
	return true
end
 
Last edited:
this one should be work :S + i tested it and works fine
Lua:
local cfg = {
        amount = 300000 -- here how many levels you want
              }
            function onUse(cid, item, fromPosition, itemEx, toPosition)
            if getPlayerLevel(cid) < 717217 then
            doPlayerAddLevel(cid, cfg.amount)
            doCreatureSay(cid, "CONGRATULATIONS! You Have Advanced 300k Levels!. ", TALKTYPE_ORANGE_1)
            doRemoveItem(item.uid,1)
            else
            doPlayerSendCancel(cid,"You no can used this if you are level 717217.")
            end
            return TRUE
            end

evans script still working perfect, thanks anyways sirion_mido
 
Back
Top