• 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 How i fix advance save?

demon47

New Member
Joined
Dec 11, 2012
Messages
59
Reaction score
2
Location
Belgium
Hello Otland users!
I wanna ask to somebody for help me with this.
[28/5/2013 20:4:56] [Error - CreatureScript Interface]
[28/5/2013 20:4:56] data/creaturescripts/scripts/advancesave.lua:eek:nAdvance
[28/5/2013 20:4:56] Description:
[28/5/2013 20:4:56] attempt to index a nil value
[28/5/2013 20:4:57] stack traceback:
[28/5/2013 20:4:57] [C]: in function 'doSendMagicEffect'
[28/5/2013 20:4:57] data/creaturescripts/scripts/advancesave.lua:15: in function <data/creaturescripts/scripts/advancesave.lua:7>
The server is always laggy then like 2 seconds, maybe somebody can help me :D :D ?
 
Last edited:
Lua:
local config = {
	savePlayer = true,
	healPlayerOnLevel = true,
	effectType = 30
}

function onAdvance(cid, skill, oldLevel, newLevel)
	if(skill == SKILL__EXPERIENCE) then
		return true
	end

	if(skill == SKILL__LEVEL and config.healPlayerOnLevel) then
		doCreatureAddHealth(cid, getCreatureMaxHealth(cid) - getCreatureHealth(cid))
		doCreatureAddMana(cid, getCreatureMaxMana(cid) - getCreatureMana(cid))
		doSendMagicEffect(pos, config.effectType)
	end

	if(config.savePlayer) then
		doPlayerSave(cid, true)
	end

	return true
end
 
Last edited by a moderator:
Back
Top