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

Kill creature, set storage to everyone who did dmg to it

EvoSoft

Is Da Mapper
Joined
Mar 10, 2010
Messages
693
Reaction score
5
Location
Northen part of Sweden
Hi!

I have this script where the guy who last hits the creature gets the storage value.
I want it to be EVERYONE who did dmg to the creature.
Here's the script:
LUA:
function onKill(cid, target)
 
local config = {
	["zugurosh"] = {amount = 1, storage = 32991, doorstorage = 1994},
	["madareth"] = {amount = 1, storage = 32992, doorstorage = 1995},
	["latrivian"] = {amount = 1, storage = 32993, doorstorage = 1996},
	["annihilion"] = {amount = 1, storage = 32994, doorstorage = 1997},
	["hellgorak"] = {amount = 1, storage = 32994, doorstorage = 1998}
}
 
local monster = config[getCreatureName(target):lower()]
 
	if(isPlayer(target)) or not monster then
		return true
	end
 
	if getPlayerStorageValue(cid, monster.storage) >= -1 and (getPlayerStorageValue(cid, monster.storage) +1) < monster.amount then		
		setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) +1)
	end
	if (getPlayerStorageValue(cid, monster.storage) +1) == monster.amount then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congratulations, you have killed "..getCreatureName(target).."s and can now pass to the next door.")
		setPlayerStorageValue(cid, monster.storage, getPlayerStorageValue(cid, monster.storage) +1)
		setPlayerStorageValue(cid, monster.doorstorage, 1)
	end
	return true
end
 
Last edited:
Back
Top