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

If one or more kill a monster receive an item all the people who was kill the monster

narko

vertrauenswürdig ~
Joined
Oct 19, 2008
Messages
1,317
Solutions
2
Reaction score
132
Location
Unknown
I want script i hope if someone can help me.

Explanation.
If one or more kill a monster receive an item all the people who was kill the monster...

I'll add u rep if u helpme....
 
Code:
function onKill(cid, target, damage, flags)
doPlayerAddItem(cid,1884,1) 
doPlayerSendTextMessage(cid,21,"You just gained an item") 
end

Just change the id of the item here
Code:
(cid,[COLOR="#FF0000"]1884[/COLOR],1)

Rep will help me a lot :)
 
Code:
function onKill(cid, target, damage, flags)
doPlayerAddItem(cid,1884,1) 
doPlayerSendTextMessage(cid,21,"You just gained an item") 
end

Just change the id of the item here
Code:
(cid,[COLOR="#FF0000"]1884[/COLOR],1)

Rep will help me a lot :)

This script will cause errors and debug.

- - - Updated - - -

Creaturescripts/creaturescripts.xml add this line:
<event type="kill" name="KR" event="script" value="killreward.lua"/>

Then go to Creaturescripts/scripts/login.lua and add this line:
Code:
registerCreatureEvent(cid, "KR")

Now create new lua at Creaturescripts/scripts and name it "killreward" add paste the script below:

LUA:
local Cyko = {
	Monster = "Demon",
	Reward = 2160
}
 
function onKill(cid, target)
	if (not isMonster(target)) then
		return false
	end
	if getCreatureName(target) == Cyko.Monster then
		doPlayerAddItem(cid, Cyko.Reward, 1) 
		end
	return true
end
 
Last edited:
Try:
LUA:
local Cyko = {
	Monster = "Demon",
        Monster2 = "Ferumbras",
	Reward = 2160
}
 
function onKill(cid, target)
	if (not isMonster(target)) then
		return false
	end
	if getCreatureName(target) == Cyko.Monster and getCreatureName(target) == Cyko.Monster2 then
		doPlayerAddItem(cid, Cyko.Reward, 1) 
		end
	return true
end
 
Thanks Cyko.
Code:
local monster = 
	{
		["Demon"] = {reward=2160,count=3}	
	}
 
function onKill(cid, target)
	if (not isMonster(target)) then
		return true
	end
local v = monster[getCreatureName(target)]
	if v then
		doPlayerAddItem(cid, v.reward, v.count)
		end
	return true
end
 
Last edited:
Back
Top