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

I found this script by lucaszolson please someone can you edit it rep!

Printer

if Printer then print("LUA") end
Senator
Premium User
Joined
Dec 27, 2009
Messages
5,780
Solutions
31
Reaction score
2,299
Location
Sweden?
Instead reward if you kill someone more than 3 times with the ip: 192.168.222.13 you will not gain any exprience and after 10 min then you can kill him 3 times again. but you can kill other person only that person with that ip you cant get exp after 10min.

Rep for the guy who make it :)


Code:
local block_kills_acc = {}
local block_kills_ip = {}
local max_kills_per_target_account = 3
local max_kills_per_target_ip = 3
 
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, 1)
		else
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You killed " .. getCreatureName(target) .. " too many times. NO REWARD!")
		end
	end
	return true
end
 
LUA:
local killFromIp = 0
function onKill(cid, target, lastHit)
	if isPlayer(target) then
		local bACC, bIP = {}, {}
		local pid, acc, ip = getPlayerGUID(cid), getPlayerAccountId(target), getPlayerIp(target)
		if not bACC[pid] then
			bACC[pid], bIP[pid] = {}, {}
		end
		if(killFromIp ~= 0) then stopEvent(killFromIp) end

		killFromIp = addEvent(function()
			bACC[pid][acc] = (bACC[pid][acc] or 0) + 1
			bIP[pid][ip] = (bIP[pid][ip] or 0) + 1
			if bACC[pid][acc] >= 3 and bIP[pid][ip] >= 3 then
				doPlayerSetRate(cid, SKILL__LEVEL, 0)
				doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "You killed " .. getCreatureName(target) .. " too many times.")
			else
				bACC[pid][acc] = 0
				bIP[pid][ip] = 0
				doPlayerSetRate(cid, SKILL__LEVEL, 1)
			end
		end, 10*1000)
	end
	return true
end

previously I added what you wanted. Did not write that script does not work :P
now improved, check it :)

-- edit
http://otland.net/f82/onkill-if-you-kill-someone-more-than-3-times-146104/
 
Last edited:
i have tested didnt work bro :/ please post the xml so i make it 100% sure :)
 
i tested but a problem when i kill someone he get stuck with no life over hes head and no name he dont die xd then when i walking from the screen he die and its not the player name it say killed by death. then if i firebomb my self then walk with 0 hp xD wtf! even monster cant die!
 
Last edited:
bro it didnt work, i gain still exp after kill same player 3 times :/ could you post what i gone write in creaturescript xml
 
hmm i can post a other script its look it but need edit :P Instead the killer die if he kill the same person 3x, he dont gain exp until 10min has gone and make it with storages instead qurey



By darkhaos

Gogo andy bro i belive on you <3

Code:
function onKill(cid, target, lastHit)
 
local timeWithinKill = 300 --in seconds
local killsLimit = 3 --limit to die
local lastKill, lastKillTime = nil, nil
local storage = 65535 --storage to check if player has killed another player 'killsLimit' times
 
 if(isPlayer(target) == false) or (isMonster(cid) == true) then
  return true
 end
 
 query = db.getResult("select lastKill, lastKillTime from players where id = " .. getPlayerGUID(cid) .. ";")
 if(query:getID() ~= -1) then
  lastKill, lastKillTime = query:getDataInt("lastKill"), query:getDataInt("lastKillTime")
  if(lastKill == getPlayerGUID(target)) then
   if(os.clock() - lastKillTime) < timeWithinKill then
    if(getPlayerStorageValue(cid, storage) < 0) then
     doPlayerSetStorageValue(cid, storage, 0)
    end
    doPlayerSetStorageValue(cid, storage, getPlayerStorageValue(cid, storage) + 1)
    if(getPlayerStorageValue(cid, storage) >= killsLimit) then
     doCreatureAddHealth(cid, -getCreatureHealth(cid))
    end
   else
    doPlayerSetStorageValue(cid, storage, 0)
   end
  end
  db.executeQuery("update players set lastKill = " .. getPlayerGUID(target) .. ", lastKillTime = " .. os.clock() .. " where id = " .. getPlayerGUID(cid) .. ";")
 else
  return LUA_ERROR
 end
 return true
end
 
Last edited:
Back
Top