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

ITEM on KILL (frag nugget when players kill another player)

Elox

http://elox.se/
Joined
Jul 5, 2008
Messages
624
Reaction score
2
Location
Sweden, Fagersta
Hello!

I've always had a Frag nugget system on my server but since they changed the deathlist system, it stopped working. (TFS 0.3.6)

When a player kills another player that is level 120+ he should get a Frag nugget.
I've tried using onKill function but apparently I'm a retarded scripter. :peace:

I tried to do a new one with onKill, but can't get it to work.
Code:
 function onKill(cid, target, lastHit)
if (isPlayer(lastHit) == TRUE) and (getPlayerLevel(cid) >= 120) then
		local item = doPlayerAddItem(lastHit, 2157, 1)
doItemSetAttribute(item, "description", "It's a trohpy you gained for killing " .. getCreatureName(cid) .." when he was level "..getPlayerLevel(cid)..".")
	end
	return TRUE
end

This script might be 100% retarded, but well I post it anyway.
What am I doing wrong? I get no errors or anything. :confused:
Used "onDeath" function before, but as you probably know they have changed it.

Help appreciated!
 
Code:
function onKill(cid, target, lastHit)
	if(lastHit and isPlayer(target) and getPlayerLevel(target) >= 120) then
		doItemSetAttribute(doPlayerAddItem(cid, 2157, 1), "description", "It's a trophy you gained for killing " .. getCreatureName(target) .. " when " .. (getPlayerSex(target) == 0 and "she" or "he") .. " was level " .. getPlayerLevel(target) .. ".")
	end
	return true
end
 
Code:
function onKill(cid, target, lastHit)
	if(lastHit and isPlayer(target) and getPlayerLevel(target) >= 120) then
		doItemSetAttribute(doPlayerAddItem(cid, 2157, 1), "description", "It's a trophy you gained for killing " .. getCreatureName(target) .. " when " .. (getPlayerSex(target) == 0 and "she" or "he") .. " was level " .. getPlayerLevel(target) .. ".")
	end
	return true
end

All right, I wasn't totally retarded after all! ^_^
I'll try it out tonight, thank you!
 
Back
Top