• 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 Exp scroll rep ++

Bondy

New Member
Joined
Mar 28, 2009
Messages
282
Reaction score
1
I use this script:

local exp = 5000000

function onUse(cid, item, fromPos, itemEx, toPos)
if getPlayerLevel(cid) >= 8 then
doPlayerAddExp(cid, exp)
doSendPlayerTextMessage(cid, 22, "You have gained ".. exp .." experience points.")
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You must be atleast level 8 to use this.")
end
end

It works fine, but it doenst dissapear! Can someone help me? thanks
 
Code:
local exp = 5000000

function onUse(cid, item, fromPos, itemEx, toPos)
if getPlayerLevel(cid) >= 8 then
doPlayerAddExp(cid, exp)
doSendPlayerTextMessage(cid, 22, "You have gained ".. exp .." experience points.")
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
return TRUE
else
doPlayerSendCancel(cid, "You must be atleast level 8 to use this.")
end
end
 
Code:
local cfg = {
	max = 100, -- Maximum Level to Use
	add = 10 -- Levels to Add
    }
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if(getPlayerLevel(cid) < cfg.max)then
		doPlayerAddExperience(cid, getExperienceForLevel(getPlayerLevel(cid)) + cfg.add)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You have recieved ".. cfg.add .." levels.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_FIREWORKS)
		doRemoveItem(item.uid)
	else
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You have exceeeded the max level to use this.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return true
end
 
try this one

Lua:
function onUse(cid, item, fromPos, itemEx, toPos)

local exp = 5000000
if (item.id == 2140 then
if getPlayerLevel(cid) >= 8 then
doPlayerAddExp(cid, exp)
doSendPlayerTextMessage(cid, 22, "You have gained "..exp.." experience points.")
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
else
doPlayerSendCancel(cid, "You must be atleast level 8 to use this.")
end
end
 
Im sorry, but I have another problem. I dont want it to give Levels, i want it to give a certain ammount of experience. Can someone fix this? thanks!
 
Code:
local exp = 5000000

function onUse(cid, item, fromPos, itemEx, toPos)
if getPlayerLevel(cid) >= 8 then
doPlayerAddExp(cid, exp)
doSendPlayerTextMessage(cid, 22, "You have gained ".. exp .." experience points.")
doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
doRemoveItem(item.uid)
return TRUE
else
doPlayerSendCancel(cid, "You must be atleast level 8 to use this.")
end
end
or you could use
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
		  if getPlayerLevel(cid) >= 8 and getPlayerLevel(cid) <= 250 then  
			doCreatureSay(cid, "You Gained 30000000 Experience!", TALKTYPE_ORANGE_1)
			doPlayerAddExp(cid, 30000000)
			doSendMagicEffect(fromPosition, CONST_ME_GIFT_WRAPS)
			doRemoveItem(item.uid)
			return TRUE
		else
			doCreatureSay(cid, "You must be level 8 or above to use this ticket.", TALKTYPE_ORANGE_1)
		end
end
Both should work, guess you havn't tried the first one. Notice that the second one has got a limit level, (250)
 
Last edited:
Back
Top