• 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 Searching for a Script

Ralesan

New Member
Joined
Oct 26, 2008
Messages
24
Reaction score
0
Hello,

I´ve searching a script that i need for my pvp-enfo server but i don't find it.

In the server im working the players starts at level 80, and i need a script that if the player is below level 80 because of a death level up him to level 80.

I saw that script in some war ots but i don't find it, if someone have it or could do it for me i will be very thankfull.

Thanks Beforehand.

PD:Srry for my bad english
pd2:im using tfs 0.3.6
 
Last edited:
You must make
Lua:
function onLogin(cid)
  if getPlayerLevel(cid) < 80 then
	return doPlayerAddLevel(cid, (80 - getPlayerLevel(cid)))
end

due to login.lua can only use one return, end. Make a new file in creaturescript with event="login" and I think it will work!.
 
You must make
Lua:
function onLogin(cid)
  if getPlayerLevel(cid) < 80 then
	return doPlayerAddLevel(cid, (80 - getPlayerLevel(cid)))
end

due to login.lua can only use one return, end. Make a new file in creaturescript with event="login" and I think it will work!.

You mean i create a new .lua with "function onlogin..." and then in creaturescrpits put
Lua:
<event type="login" name="AddLevel" event="script" value="addlevel.lua"/>

And i need to register it on login.lua?

Thank you both for helpmee, really =)
 
no don't do the way wibben says.
it will only work once that way.

go to login.lua and add these lines somewhere above the registerCreatureEvents.

Code:
if getPlayerLevel(cid) < 80 then
	return doPlayerAddLevel(cid, (80 - getPlayerLevel(cid)))
end
 
no don't do the way wibben says.
it will only work once that way.

go to login.lua and add these lines somewhere above the registerCreatureEvents.

Code:
if getPlayerLevel(cid) < 80 then
	return doPlayerAddLevel(cid, (80 - getPlayerLevel(cid)))
end

It works!! thanks
how can i give u repp

thank u bot forr tryng to helpmee

edit:done already give u rep++
 
no don't do the way wibben says.
it will only work once that way.

go to login.lua and add these lines somewhere above the registerCreatureEvents.

Code:
if getPlayerLevel(cid) < 80 then
	return doPlayerAddLevel(cid, (80 - getPlayerLevel(cid)))
end

does "doPlayerAddLevel" exist? can't find it anywhere in the functions o_O
 
Code:
doPlayerAddLevel(cid, amount, round)

yes, it does.

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
 
so instead of

Code:
doPlayerAddExperience(cid, getExperienceForLevel(getPlayerLevel(cid) + cfg.gain) - getPlayerExperience(cid))

can I just use

Code:
doPlayerAddLevel(cid, cfg.gain)

didn't see it lol
 
does "doPlayerAddLevel" exist? can't find it anywhere in the functions o_O

true true.. Its doCreatureAddLevel(cid, param)

Code:
doPlayerAddLevel(cid, amount, round)

yes, it does.

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
thats the 0.2 (old) script system all do and all player is changed to

Lua:
getCreatureHealth(cid)
doCreatureAddHealth(cid)
doCreatureAddExperience(cid)
ex..
 
Back
Top