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

[onAdvance] function

scripter5

New Member
Joined
Dec 3, 2009
Messages
18
Reaction score
0
Trying to make a script that gives a player an item when they level, here's what I have so far:

Code:
function onAdvance(cid, skill, oldLevel, newLevel)
	if(oldLevel==9) or newLevel==10 then
		doPlayerAddItem(cid, 2151, 1)

	end
	return true
end

Why doesn't this work?
 
Code:
function onAdvance(cid, skill, oldLevel, newLevel)
 if ((oldLevel == 9) and (newLevel == 10)) then
  doPlayerAddItem(cid, 2151, 1)
  end
 return TRUE
end
 
@up

2 things..
I would remove "(oldLevel == 9)" because the player could lvl from lvl 8 to 10 directly and not from 9,
Also, you need to check if skill is the lvl skill and not magic lvl or smth..
 
Back
Top