Mjmackan
Mapper ~ Writer
OTland members help me!!! 
I have been struggeling with a frag reward script, this is what i want it to do:
When you kill someone at maximum 50 levels under you, you get a trophy there it stands: The trophy belongs to "1name" for killing "2name" at level "2level" when "1name" was "1level". [Un/justified]
The trophy (id: 5805) should get sent to the pker's (lasthitters) backpack when killing someone, i would also like it to get broadcasted for everyone that "1name" killed "2name".
Here is what i was working on, not working right now cause of the
part.
I have been struggeling with a frag reward script, this is what i want it to do:
When you kill someone at maximum 50 levels under you, you get a trophy there it stands: The trophy belongs to "1name" for killing "2name" at level "2level" when "1name" was "1level". [Un/justified]
The trophy (id: 5805) should get sent to the pker's (lasthitters) backpack when killing someone, i would also like it to get broadcasted for everyone that "1name" killed "2name".
Here is what i was working on, not working right now cause of the
LUA:
local reward = {5805, 1}
doPlayerAddItem(cid, 5805, 1)
LUA:
function onDeath(cid, corpse, deathList, target, lastHit)
if isPlayer(cid) and lasthit then
local reward = {5805, 1}
doPlayerAddItem(cid, 5805, 1)
if(isPlayer(deathList[1])) then
local v = { killer_name = getCreatureName(deathList[1]), killer_level = getPlayerLevel(deathList[1]), target_name = getCreatureName(cid), target_level = getPlayerLevel(cid) }
doItemSetAttribute(reward), "description", "You see a trophy it belongs to " .. v.killer_name .. " for killing " .. v.target_name .. " at level " .. v.target_level .. " at " .. v.killer_name .. " who was level " .. v.killer_level .. " at the time. " .. (getCreatureSkullType(cid) <= SKULL_GREEN and "[Unjustified]" or "[Justified]"))
doItemSetAttribute(reward, "name", v.target_name .."'s Heart")
end
end
return true
end