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

if a skill drops below x level.

calum69

New Member
Joined
Aug 12, 2007
Messages
346
Reaction score
3
Location
Great Britain
hello i tried a function, it didnt come up with errors but it didnt work

LUA:
if playerVoc == 4 and getPlayerSkill(cid, SKILL_SWORD) < 68 then
doPlayerAddSkillTry(cid, SKILL_SWORD, ReqTries(cid, SKILL_SWORD, 70))
end
return true
end

and it didnt do anything.

yes a checked if the skill was below 68, yes i checked if it was a knight.

anyone know how to do it?

because im setting a lowlevel lock for skills aswell as level for my war server.
 
Last edited:
Post the full script, dude

edit;
1. If you haven't done so before, open 050-Functions.lua and replace your doPlayerAddSkill function with this(Couldn't find cykotitans thread. Maybe if you use 0.4 you dont need to do this, I dont know as I don't have it):
Code:
function doPlayerAddSkill(cid, skill, amount, round)
	if(skill == SKILL__LEVEL) then
		return doPlayerAddLevel(cid, amount, round)
	elseif(skill == SKILL__MAGLEVEL) then
		return doPlayerAddMagLevel(cid, amount)
	end

	return doPlayerAddSkillTry(cid, skill, math.ceil((getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill)) / getConfigInfo('rateSkill')))
end

and the script:
Code:
function onLogin(cid)
	if getPlayerVocation(cid) == 4 and getPlayerSkill(cid, SKILL_SWORD) < 68 then
		for i = 1, -getPlayerSkillLevel(cid, SKILL_SWORD)+70 do doPlayerAddSkill(cid, SKILL_SWORD, 1) end
	end
return true
end
 
Last edited:
Back
Top