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

Solved if up level ( get max mana and hp )

Status
Not open for further replies.

megazx

Graphic designer
Joined
Mar 4, 2013
Messages
444
Solutions
2
Reaction score
32
Location
Egypt
PHP:
function onAdvance(cid, skill, oldlevel, newlevel)
local ppos = getPlayerPosition(cid)
if newlevel > oldlevel then
    doSendAnimatedText(ppos, "Level Up", 210)
    doSendMagicEffect(ppos, 28)    
    doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
    doPlayerAddMana(cid, getCreatureMaxMana(cid))    
    end
return true
end


i need some one to explain where i put this script and how to make it work

I Rep++
 
LUA:
function onAdvance(cid, skill, oldlevel, newlevel)
	if newlevel > oldlevel then
		doSendAnimatedText(getPlayerPosition(cid), "Level Up", 210)
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid), CONST_ME_FIREWORK_YELLOW)
		doPlayerAddMana(cid, getCreatureMaxMana(cid))    
	end
	return true
end

Here, this looks better and should be exactly the same.
The script goes in your creaturescripts folder. Be sure to register it in Login.lua and your creaturescripts.xml file.

Red
 
creaturescripts.xml
XML:
<event type="advance" name="Advance" event="script" value="advance.lua"/>
login.lua
LUA:
	registerCreatureEvent(cid, "Advance")
You can choose the name and the lua file name.
 
do i put this

registerCreatureEvent(cid, "Advance")

in login at any place

- - - Updated - - -

i dont wand to break the code
 
Status
Not open for further replies.
Back
Top