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

''character minimum lvl 13''

Robwin

Member
Joined
Dec 13, 2008
Messages
81
Reaction score
11
Location
Sweden
hello as topic says I want to make the lowest lvl on the char 13. so incase your 13 and die to 12 u get lvl 13 again, is this possible? ifso could some1 help me out
 
<event type="login" name="Minlvl" event="script" value="Minlvl.lua"/> should I add this to the xml file? xd

edit:I tried it, the script works but I could only logg on the server once after I logged out I cant logg on again :|
 
Code:
function onLogin(cid)
	if getPlayerLevel(cid) < 13 then
		return doPlayerAddLevel(cid,(13-getPlayerLevel(cid)))
	end
[B][COLOR="Red"]	return true[/COLOR][/B]
end
 
okay, hope it works :/
if you're using TFS 0.3.6 you can't reload creaturescripts (if you do, don't be surprised if it crashes next time some creaturescript is executed)
 
ok it works nice thanks, but is it possible to make it start at exactly lvl 13 cause now it gets 1 full lvl, like this if it dies down to 20% to lvl 13 it gets 20% to 14. maybee make it like this if below exp 23200(lvl 13) it get backs to 23200exp (lvl 13) ty once again
 
Thought you'd ask.
Code:
function onLogin(cid)
	if getPlayerLevel(cid) < 13 then
		return doPlayerAddLevel(cid, 13-getPlayerLevel(cid)[B][COLOR="Red"], true[/COLOR][/B])
	end
	return true
end
 
That's not possible. Post the function doPlayerAddLevel from data/lib/050-function.lua
It should look exactly like this:
Code:
function doPlayerAddLevel(cid, amount, round)
	local experience, level = 0, getPlayerLevel(cid)
	if(amount > 0) then
		experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level))
	else
		experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount))
	end

	return doPlayerAddExperience(cid, experience)
end
 
it looks exactly like that one :|


<event type="login" name="Minlvl" event="script" value="Minlvl.lua"/>
but is this alright? from the xml creaturefile
 
but isnt it possible to make it by exp instead? like if I get below exp for lvl 13 I get the exp that u have at lvl 13? or smthing familiar
 
Code:
function onLogin(cid)
	if getPlayerLevel(cid) < 13 then
		doPlayerAddExperience(cid, getExperienceForLevel(13) - getPlayerExperience(cid))
	end
	return true
end
 
Back
Top