• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

1 script need help with

Elaney

Member
Joined
Jan 1, 2009
Messages
1,561
Reaction score
12
Location
Sweden
script is

what i want the script to do is when the player get level 100 he gets 5 sword skill.

LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	if getPlayerLevel(cid) >= 104 then
	if getPlayerStorageValue(cid, 6002) == -1 then
		doCreatureSetStorage(cid, 6002, 1)
		doPlayerAddSkill(cid, SKILL_SWORD, 5)
	end
end
	return true
end
 
what if the player advance from lvl 99 to 101? :P

LUA:
function onAdvance(cid, skill, oldLevel, newLevel)
	if (getPlayerLevel(cid) >= 100 and getPlayerStorageValue(cid, 6002) == -1) then
	    doPlayerAddSkill(cid, SKILL_SWORD, 5)
	    setPlayerStorageValue(cid,6002,1)
        else
            -- do nothing
        end
	return true
end

The words "else" and "-- do nothing" are not required, if you want to remove. (Its like a reminder or idk) x)
 
LUA:
local storage = 6002
function onAdvance(cid, skill, oldLevel, newLevel)
	if skill == SKILL__LEVEL then
		if isKnight(cid) then
			if oldLevel <= 99 and newLevel >= 100 then
				if getPlayerStorageValue(cid, storage) < 0 then
					doPlayerAddSkill(cid, SKILL_SWORD, 5, false)
					doSendMagicEffect(getThingPos(cid), CONST_ME_MAGIC_BLUE)
				end
			end
		end
	end
	
	return true
end
 
Last edited:
Back
Top