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

Request: Simple level up! Rep++

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
When the player get 1 level up it will heal only the creatures hp to full, effect fireworks and red text level up!


Rep++
 
LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
		local p = getThingPos(cid)
		doSendMagicEffect(p, math.random(28, 30))
		doSendAnimatedText(p, 'LEVEL UP', TEXTCOLOR_RED)
	end
	return true
end
 
Is this right?

on creaturescripts xml dokument <event type="advance" name="lvlup" event="script" value="lvlup.lua"/>

and on login lua registerCreatureEvent(cid, "Lvlup")
 
data\creaturescripts:
Code:
	<event type="advance" name="levelUp" event="script" value="custom/levelUp.lua"/>
data\creaturescripts\scripts:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
local pPos = getPlayerPosition(cid)
          if skill == SKILL__LEVEL then
        doSendAnimatedText(pPos, "Level Up", 210)
        doSendMagicEffect(pPos, 28)    
        doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
        doCreatureAddMana(cid, getCreatureMaxMana(cid))  
		end
return TRUE
end
 
Back
Top