My script don't work:
In login.LUA:
The xml tag:
Code:
function onAdvance(cid, skill, oldlevel, newlevel)
if ((newlevel == 100) and (getPlayerGroupId(cid) <= 2)) then
doBroadcastMessage(getCreatureName(cid).." advanced from Level "..oldlevel.." to Level "..newlevel..".")
elseif ((newlevel == 200) and (getPlayerGroupId(cid) <= 2)) then
doBroadcastMessage(getCreatureName(cid).." advanced from Level "..oldlevel.." to Level "..newlevel..".")
elseif ((newlevel == 300) and (getPlayerGroupId(cid) <= 2)) then
doBroadcastMessage(getCreatureName(cid).." advanced from Level "..oldlevel.." to Level "..newlevel..".")
elseif ((newlevel == 400) and (getPlayerGroupId(cid) <= 2)) then
doBroadcastMessage(getCreatureName(cid).." advanced from Level "..oldlevel.." to Level "..newlevel..".")
elseif ((newlevel == 500) and (getPlayerGroupId(cid) <= 2)) then
doBroadcastMessage(getCreatureName(cid).." advanced from Level "..oldlevel.." to Level "..newlevel..".")
end
return TRUE
end
In login.LUA:
Code:
registerCreatureEvent(cid, "playerAdvance")
The xml tag:
Code:
<event type="advance" name="PlayerAdvance" script="playeradvance.lua"/>