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

On advance to x level doPlayerSendTextMessage

Gaddhuve

Member
Joined
May 6, 2011
Messages
76
Solutions
1
Reaction score
19
All I want is when a player reach x level she gets this message
Lua:
 function onAdvance(cid, skill, oldLevel, newLevel)
        if(newLevel >= 40 and getPlayerStorageValue(cid, 99882) < 1) then
                doSendMagicEffect(getCreaturePosition(cid), CONST_ME_HOLYAREA)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "New rank achived!")
                setPlayerStorageValue(cid, 99882, 1)
        end
        return true
end

But it is not working for some reason, anyone know why?
 
btw this script doesn't check the type of skill, then the player will gain the storage even if the newlvl 40 is club fighting or magic lvl or fishing or etc
 
Lua:
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL and newLevel >= 40 and getCreatureStorage(cid, 99882) == -1 then
		doCreatureSetStorage(cid, 99882, 1)
		doSendMagicEffect(getThingPos(cid), CONST_ME_HOLYAREA)
		doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, 'New rank achived!')
	end
	return true
end
don\'t forget login.lua
 
Back
Top