• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Get 100gp when kill another player

RealSoft

Banned User
Joined
Feb 3, 2009
Messages
4,381
Reaction score
92
Location
There I sleep
This scripts is made by Shawak. so give him rep!
and rep me for bring this up!

I modified so you loot 100gp!
if you want something else change the "loot"


create in..
data/creaturescripts/sctipts/reward.lua
PHP:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	local cidpos = getPlayerPosition(lastHitKiller)
	loot = 2152 --Platinum coin
	item = doPlayerAddItem(lastHitKiller,loot,1)
	if(isPlayer(lastHitKiller) == TRUE) then
		hitKillerName = getPlayerName(lastHitKiller)
		doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..hitKillerName..".")
		doPlayerSendTextMessage(lastHitKiller, MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
		doSendMagicEffect(cidpos,12)
	else
		hitKillerName = getCreatureName(lastHitKiller)
		doSetItemSpecialDescription(item,"This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by a "..hitKillerName..".")
	end
	setItemName(item, ""..getPlayerName(cid).."\'s Heart")
	return TRUE
end
add in..
data/creaturescripts/creatuescripts.xml
PHP:
	<event type="death" name="Reward" script="reward.lua"/>
add in..
data/creaturescripts/sctipts/login.lua
PHP:
	registerCreatureEvent(cid, "Reward")
 
Last edited by a moderator:
Well you really did a bad job, if it's money.. is it really necessary to keep setting a description?
 
Why having the heart in the script? Not sure, but it won't work right? you'll get the GP but not the heart....??lol
 
stackable items also lose description when stack count changes
 
First I want to say, Moderators, For fuck sake don't delete threads, or close them before they're done, I gave a kid support and was looking for script to him, when I get back the thread was deleted and I didn't even had hes name! <.<

Fuck Sake Watch Out for your damn delete buttons!
Some mod deleted a post of mine unjustified, By Misstake as I get to know today...

Don't come here cursing and blaming moderators for closing/deleting threads for a little mistake made. If a thread is not following the rules, it will be deleted no matter what you think. Also Xenios is a human and he can make mistakes too (like everyone of us) and yet you seem to be mad at his action even though he admited he made a mistake and undeleted your thread which is lame in my opinion. Don't expect us to be absolute gods when it comes to moderating, we're humans not robots.
 
Looks like someone pulled of a 'frankfarmer' ..

Hahahahah :D

Anyway, isnt this script kinda weird? I mean it gives the player a platinum coin that says "this is the heart of.." lol.

Btw, the principal reason of why this is a "frankfarmer" (or a "beon" for that matter) is the fact that you in your thread mention "credits to shawak", however why did you remove the credits from the script? :confused:

As you can see here in the original thread:
http://otland.net/f82/frag-reward-23054/

The credits line was there, but here it isnt :eek: And the only thing you did was changing the heart's ID for the platinum coin ID making a very weird script that does what I stated above.

There are better ways of making "get gp from killing another player" scripts, more configurable etc.

Sorry for the flaming, but I truly dont know why this thread was made or why is it allowed to keep being open.

I guess this:
if you want something else change the "loot"

Wasnt implied already so you had to make a whole thread for it.
 
Last edited:
So you just changed the id of the heart to something that will lose its description once you stack it or do anything with it?

cool
 
Plenty of these scripts around I guess, there is a cleaner version in SWOT, though I have stopped releasing it here. It is pretty annoying when your distro thread gets denied, but you cant be sure if it has been and if it has been, you don't know why because you're not told.

I didn't write this one, only modified it for use on Simple War OT.

Code:
function onKill(cid, target, lastHit)
local reward = {
        item = 2152, --ITEM ID!
        count = 1 -- How many?
}
        if(isPlayer(cid) and isPlayer(target)) then
	if getPlayerIp(cid) ~= getPlayerIp(target) then
                doPlayerAddItem(cid, reward.item, reward.count)
else
doPlayerAddExperience(cid, -1000000)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE,"You have been punished for killing a player of the same IP.")
                end
        return true
end
end
 
Ok...let's think about it....ppl put all items in dp...make deal with friends to kill them to get reward...share loot...get money....or...go kill noob lvls get their loot + money...nah not good idea bro..+ I think it will work in arena....:wub:
 
Not tested, better version
Lua:
function onDeath(cid, deathList)
local config = {
        item = 2152,
        count = 1,
		useForPvpServer = "yes"  -- get a message of they have same ip(might be good for pvp-e servers)
}
	for _killers = 1, #deathList do
		if(getPlayerIp(deathList[_killers]) == getPlayerIp(cid) and config.useForPvpServer == "yes") then
			doPlayerSendTextMessage(deathList[_killers], MESSAGE_STATUS_CONSOLE_BLUE,"You did not receive experience or kill from that player because of same IP!")
			return true
		end
		if(isPlayer(deathList[_killers]) and isPlayer(cid)) then
			doPlayerSendTextMessage(deathList[_killers], MESSAGE_STATUS_CONSOLE_BLUE,"You received "..config.count.." "..getItemNameById(config.item).." for killing "..getCreatureName(cid))
			if(getPlayerItemCount(deathList[_killers], config.item) > 0) then
				local item = getPlayerItemById(deathList[_killers], true, config.item)
					if(item.type >= ITEMCOUNT_MAX) then
						doPlayerAddItem(deathList[_killers], config.item, config.count)
					else
						doTransformItem(item.uid, config.item, item.type + config.count)
					end
				end
			end
		end
	return true
end
choose deathAssist in config.lua :p
 
Not tested, better version
Lua:
function onDeath(cid, deathList)
local config = {
        item = 2152,
        count = 1,
		useForPvpServer = "yes"  -- get a message of they have same ip(might be good for pvp-e servers)
}
	for _killers = 1, #deathList do
		if(getPlayerIp(deathList[_killers]) == getPlayerIp(cid) and config.useForPvpServer == "yes") then
			doPlayerSendTextMessage(deathList[_killers], MESSAGE_STATUS_CONSOLE_BLUE,"You did not receive experience or kill from that player because of same IP!")
			return true
		end
		if(isPlayer(deathList[_killers]) and isPlayer(cid)) then
			doPlayerSendTextMessage(deathList[_killers], MESSAGE_STATUS_CONSOLE_BLUE,"You received "..config.count.." "..getItemNameById(config.item).." for killing "..getCreatureName(cid))
			if(getPlayerItemCount(deathList[_killers], config.item) > 0) then
				local item = getPlayerItemById(deathList[_killers], true, config.item)
					if(item.type >= ITEMCOUNT_MAX) then
						doPlayerAddItem(deathList[_killers], config.item, config.count)
					else
						doTransformItem(item.uid, config.item, item.type + config.count)
					end
				end
			end
		end
	return true
end
choose deathAssist in config.lua :p

This one isn't working for me either...

This is in creaturescripts.xml
Code:
<event type="death" name="FragReward" event="script" value="fragreward.lua"/>

no errors when the scripts executed... <_<

can someone explain whats wrong?? :D
 
This one isn't working for me either...

This is in creaturescripts.xml
Code:
<event type="death" name="FragReward" event="script" value="fragreward.lua"/>

no errors when the scripts executed... <_<

can someone explain whats wrong?? :D
did you register it in login.lua ?
 
Yup..

Here it is.
Code:
registerCreatureEvent(cid, "FragReward")
dunno if i mentioned this already... newest tfs 0.3.6 client 8.54..

Any other suggestions?? :>
 
Back
Top