• 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 Count Kill Problem

russogracie

New Member
Joined
Sep 9, 2010
Messages
205
Reaction score
2
The scoring system is wrong because you have two people attacking a demon, the second will earn points not only of death and the person who has gained more exp.

There's no fix?

Code:
 local monsters = {
	["demon"] = 9545,
}
 
function onKill(cid, target)
	if(isPlayer(target) ~= true and isPlayer(cid)) then
		local name = getCreatureName(target)
		local monster = monsters[string.lower(name)]
		if(monster) then
			local killedMonsters = getPlayerStorageValue(cid, monster)
			if(killedMonsters < 0) then
				killedMonsters = 1
			end
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. killedMonsters .. " " .. name .. "'s.")
			setPlayerStorageValue(cid, monster, killedMonsters + 1)
		end
	end
	return true
end
 
Back
Top