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

PVP-E server, minimum level

Hellrage

Worr
Joined
Oct 30, 2007
Messages
2,477
Reaction score
5
Location
Sweden
Maybe you saw my other thread, I'm looking for some new stuff untill Warloria opens again.

In this thread I want to know how to make a minimum level.

Basically, when you have 100% to level on X level the deathloss will change to 0%. For experience, skills and ml.
 
Its private accounts. You start at level 50 and top highscore is usually around 65. But there are also some poor people who rune around on level 45. I want minimum level to be 50 so you cant die to 49 and below, same with skills (but other values ofc).

ANOTHER IDEA: Is it possible to only show people who are above 52 in highscore list? But still be able to search on the character page. Sorry for side track :p
 
test:

LUA:
local x ={
		level = 100, -- when creature has level 100 he will get the scripts action.
		message = "You can not lose any experience now when you die.", -- when creature has the level he will get a message < this
}
function onAdvance(cid, skill, oldLevel, newLevel)
	if isCreature and if getCreatureLevel(cid, x.level) then
	doCreatureSetLossPercent(cid, death, 0) and doCreaturePopupFYI(cid, x.message) 
	return TRUE
end

not tested due to I have no server on this computer.
 
test:

LUA:
local x ={
		level = 100, -- when creature has level 100 he will get the scripts action.
		message = "You can not lose any experience now when you die.", -- when creature has the level he will get a message < this
}
function onAdvance(cid, skill, oldLevel, newLevel)
	if isCreature and if getCreatureLevel(cid, x.level) then
	doCreatureSetLossPercent(cid, death, 0) and doCreaturePopupFYI(cid, x.message) 
	return TRUE
end

not tested due to I have no server on this computer.

Where should I put this in? actions.xml?
 
I UNDERSTOOD IT WRONG SORRY! But hopefully you need this :D



In creaturescript.xml add
Code:
	<event type="login" name="Lowlevellock" event="script" value="lowlevellock.lua"/>
lowlevellock.lua
LUA:
function onLogin(cid)
local level = 100 --Change this to your minimium level
	if getPlayerLevel(cid) < level then
	doPlayerAddExperience(cid, (getExperienceForLevel(level) - getPlayerExperience(cid)))
end
return TRUE
end
Haven't tested but it should work :D Simply, you couldn't be lower level than 100.
 
Where should I put this in? actions.xml?

In creaturescripts.xml
Code:
	<event type="advance" name="AdvanceBack" event="script" value="AdvanceBack.lua"/>
Add Wibben's script to the scripts folder (creaturescripts > scripts) and save it with name AdvanceBack.lua
AdvanceBack.lua
LUA:
--Script made by Wibben
  local x ={
                level = 100, -- when creature has level 100 he will get the scripts action.
                message = "You can not lose any experience now when you die.", -- when creature has the level he will get a message < this
}
function onAdvance(cid, skill, oldLevel, newLevel)
        if isCreature and if getCreatureLevel(cid, x.level) then
        doCreatureSetLossPercent(cid, death, 0) and doCreaturePopupFYI(cid, x.message)
        return TRUE
end
open login.lua and
before
Code:
	registerCreatureEvent(cid, "Idle")
add
Code:
	registerCreatureEvent(cid, "AdvanceBack")
 
Back
Top