• 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!

Script fix

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Code:
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) >= 20 and getPlayerLevel(cid) <= 15999 then
        doPlayerAddExperience(cid, getExperienceForLevel(getPlayerLevel(cid)+3000)-getPlayerExperience(cid))
        doSendMagicEffect(getCreaturePosition(cid), CONST_ME_MAGIC_BLUE)
        doPlayerSendTextMessage(cid, 22, "You recieved 3000 levels!")
        doRemoveItem(item.uid,1)
        doCreatureSay(cid, "I GOT 3000 LEVELS AND NOW I AM LEVEL ".. getPlayerLevel(cid) .."!", TALKTYPE_ORANGE_1)
    else
        doSendCancel(cid "Only players above level 20 or below level 15999 can use this scroll.")
    end
end

Can someone fix this script for TFS 0.3.6? Everytime I use it and when I'm higher than 15k it lags the server
 
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	local cfg = {}
	cfg.gain = 3000
	cfg.max = 16000
	cfg.min = 20
	if getPlayerLevel(cid) > cfg.min then 
		if getPlayerLevel(cid) < cfg.max then
			doPlayerAddExperience(cid, getExperienceForLevel(getPlayerLevel(cid) + cfg.gain) - getPlayerExperience(cid))
			doCreatureSay(cid, "Congratulations! You have received " .. cfg.gain .. " levels.", TALKTYPE_ORANGE_1)
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_GIFT_WRAPS)
			doRemoveItem(item.uid, 1)
		else
			doPlayerSendCancel(cid, "Your level is too high.")
			doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		end
	else
		doPlayerSendCancel(cid, "Your level is too low.")
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
	end
	return true
end
 
Last edited:
Yea thanks, lol...
Quick script coding is like typing a paper, but there's no spell check?!
 
Back
Top