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

OnKill Creaturevent

Rury

Member
Joined
Nov 25, 2012
Messages
74
Reaction score
7
How can configure this script for only the 2 murderers that appear in the death list earn points?

Lua:
function onKill(cid, target, lastHit)
			if(lastHit == true) then
		      doPlayerAddPoints(cid, 1)
			end
	return true
end

I think if replacement true by false (lastHit), all players earn points.
 
Try this out:
Lua:
local assist = 2 --how many players which assist on kill, should recive the reward!
function onDeath(cid, corpse, deathList)
	if getCreatureName(cid):lower() == "Demon" then
		for i = assist, #deathList do
			if isPlayer(deathList[i]) then
				doPlayerAddPoints(cid, 1)
				break
				end
		  end
	end
	return true
end
 
Back
Top