• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

medal reward at killing someone

Thorn

Spriting since 2013
Joined
Sep 24, 2012
Messages
2,203
Solutions
1
Reaction score
923
Location
Chile
Hi it me again :S, i would want a script for this: when u kill someone (u get PK so its and unjustified killing) u get a medal reward with some description like you have kil X player, something like that, only if is possible >,< i couldn't find it in the search
 
Just change the Item ID "2152" to the item you want to get.

LUA:
local block_kills_acc = {}
local block_kills_ip = {}
local max_kills_per_target_account = 3
local max_kills_per_target_ip = 5
 
function onKill(cid, target, lastHit)
	if isPlayer(target) then
		local g, a, ip = getPlayerGUID(cid), getPlayerAccountId(target), getPlayerIp(target)
		if not block_kills_acc[g] then
			block_kills_acc[g] = {}
			block_kills_ip[g] = {}
		end
		block_kills_acc[g][a] = (block_kills_acc[g][a] or 0) + 1
		block_kills_ip[g][ip] = (block_kills_ip[g][ip] or 0) + 1
		if block_kills_acc[g][a] <= max_kills_per_target_account and block_kills_ip[g][ip] <= max_kills_per_target_ip then
			doPlayerAddItem(cid, 2152)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You have killed " .. getCreatureName(target) .. ". You get a reward.")
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You killed " .. getCreatureName(target) .. " too many times. NO REWARD!")
		end
	end
	return true
end
 
sorry pandarohoo your script is not working for me :S nothing happens

- - - Updated - - -

Tai i have this error >.<
[Warning - Event::loadScript] Event onDeath not found (data/creaturescripts/scripts/frag_reward.lua)
 
Back
Top