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

War Server - Killing.

DonMuha

New Member
Joined
Jun 25, 2011
Messages
18
Reaction score
0
Hello. I need script or idea how make this script: If I kill player 1 and after 5 seconds (or less) I kill player 2 I found 200 gold coins (+ animated text "Double Kill") and so on... Multi Kill -> Ultra Kill

@Edit
Yes, I done it! onKill, addEvent + storages ;)
 
Last edited:
LUA:
local config = {
	-- [kills] = {'text', money}
	[2] = {'Double', 200},
	[3] = {'Triple', 1000},
	[4] = {'Ultra', 2000}
}

addEventStorage = 6546 -- set free storage
killCount = 57587 -- set free storage
timeBettwenKills = 20 -- seconds

function onKill(cid, target, lastHit)
	if isPlayer(cid) then
		if getCreatureStorage(cid, killCount) >= 1 then
			doCreatureSetStorage(cid, killCount, getCreatureStorage(cid, killCount) + 1)
			stopEvent(getCreatureStorage(cid, addEventStorage))
			
			doSendAnimatedText(getThingPos(cid), config[getCreatureStorage(cid, killCount)][1], TEXTCOLOR_RED)
			addEvent(doSendAnimatedText, 300, getThingPos(cid), 'kill', TEXTCOLOR_RED)
			doPlayerAddMoney(cid, config[getCreatureStorage(cid, killCount)][2])
		else
			doCreatureSetStorage(cid, killCount, 1)
		end
		event = addEvent(setStorage , timeBettwenKills * 1000, cid, killCount, getPlayerGUID(cid))
		doCreatureSetStorage(cid, addEventStorage, event)
	end
	return true
end

function setStorage(cid, storage, GUID)
	if isPlayer(cid) then
		doCreatureSetStorage(cid, storage, -1)
	else
		db.executeQuery('UPDATE `player_storage` SET `value` = -1 WHERE `player_id` = ' .. GUID  .. ' AND `key` = ' .. storage)
	end
end

Not sure that it will work on your TFS.
 
Back
Top