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

Lua doPlayerSetNewLevel?

Santi

Theres no way im stopping
Joined
Aug 29, 2010
Messages
1,975
Reaction score
152
Location
00
Is there any function that makes a player get a new level? Like for example you are level 130 downgrade it to 8 again?
Obviously just to downgrade since you can use doPlayerAddExp to make it higher
Thanks in advanced, and rep +
 
nope, there isn't
you can do: logout player, at database edit player's level and exp using previous player's GUID stored as a local var
 
You sure? Cause I've seen some thing I think it was rebirth or reborn system? that when you reach certain level you get back to the level you started.
And yeah, knew bout the db already, thank you.
 
Then use that system, stop asking for stuff that already exists...
It's in the resources section, under requests or creaturescripts.
 
@up: I just was getting sure if there was any function to do it, plus I just remembered I've seen that rebirth system once.
 
Try this

Lua:
function setPlayerLevel(cid,level,experience)
	doRemoveCreature(cid)
	db.executeQuery("UPDATE `players` SET `level` = "..level..", `experience` = "..experience.." WHERE `id` = "..getPlayerGUID(cid))
end
 
lol i donno why you do that but you can simply make :
Lua:
function setLevel(cid,lev)
return isPlayer(cid) and doPlayerAddLevel(cid,lev - getPlayerLevel(cid))
end
 
Back
Top