• 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 Exp for killing player, creaturescripts?

Xleniz

New Member
Joined
Jul 6, 2009
Messages
178
Reaction score
3
Location
Sweden
I cant get config.lua work with exp for killing players, so I made a script, though its not working (makes players lvl 1 when killing).
Can anyone get right formula ?

LUA:
function roundNum(val, decimal)
	if (decimal) then
		return math.floor(((val * 10^decimal) + 0.5) / (10^decimal))
	else
		return math.floor(val+0.5)
	end
end

function onKill(cid, target)
	if(isPlayer(target)) then
	if(getPlayerLevel(cid) < getPlayerLevel(target)) then
	doPlayerAddExperience(cid, roundNum((getExperienceForLevel(getPlayerLevel(cid)*(getPlayerLevel(target)/10)) - getPlayerExperience(cid)), 0))
	end
	end
	return true
end
 
Back
Top