function onDeath(cid, corpse, deathList)
if isPlayer(deathList[1]) then
local item = doAddContainerItem(corpse.uid, 5943, 1)
doItemSetAttribute(item, "description", "This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".")
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
doSendMagicEffect(getPlayerPosition(deathList[1]), CONST_ME_MAGIC_BLUE)
end
return true
end
registerCreatureEvent(cid, "Reward")
<event type="death" name="Reward" event="script" value="reward.lua"/>
On data/creaturescripts/scripts/fragreward.lua
Change DoPlayerAdditem (XXXX) Crystal Coin > 2160.
PHP:function onKill(cid, target, lastHit) if cid ~= target and isPlayer(target) then if getPlayerIp(cid) == getPlayerIp(target) then doPlayerAddExperience(cid, -1000000) doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'You have been punished for killing a player of the same IP.') else local attackerLevel, level = getPlayerLevel(cid), getPlayerLevel(target) if level >= math.floor(attackerLevel * 0.5) and level <= math.floor(attackerLevel * 1.5) then doPlayerAddItem(cid, 2160, 1) end end end return true end
creaturescript/login.lua
Lua:[php]registerCreatureEvent(cid, "FragReward")[/php] [I]Creaturescripts/[B]c[/B]reaturescripts.xml[/I] [php] <event type="kill" name="FragReward" event="script" value="fragreward.lua"/>[/php][/QUOTE] did you understand what i need? lol i need to find something on human of died one btw i made this script and nothing when i kill another char >.<
mmm i didnt find anything + i didnt get bug on consle :S 0,0 may you log in 197.37.32.98 to check it?/Updated.
what? i need a script to find a heart on a human and when i look on it i find name of killer + level on died one level/name and data if is it possiblewhat your mean?
function onDeath(cid, corpse, deathList)
deathList[1]
sorry but i made all what you said and still nothingIf youre using 3.0.6 my script should work, so check if you've added this.
Data/Creaturescript/Creaturescript.xml
<event type="death" name="Reward" script="reward.lua"/>
Data/Creaturescript/login.lua
registerCreatureEvent(cid, "Reward")
0.3.6Post your server version.
The third parameter in TFS 0.3.6 is a deathlist table, to get the killer useCode:function onDeath(cid, corpse, deathList)
Or lastHitKiller[1] if you call it like that.Code:deathList[1]
The third parameter in TFS 0.3.6 is a deathlist table, to get the killer useCode:function onDeath(cid, corpse, deathList)
Or lastHitKiller[1] if you call it like that.Code:deathList[1]
<event type="death" name="Reward" event="script" value="reward.lua"/>
aff sorry i can't do it that's what i did and still nothing -.- please edit it and give me it cuz im not good at scripting just edit it and give me it pleaseI know because I saw that in other threads but other people don't, you have to add that in every new thread you make.
The third parameter in function onDeath in TFS 0.3.6 is a table with the killers, to get the killer use [1] behind it to get the first value in the table which is the creatureid of the killer.
In creaturescripts.xml you have to use event and value.
Code:<event type="death" name="Reward" event="script" value="reward.lua"/>
i gave up !! affi dont need it -.-!!!!!Change lastHitKiller[1] and lastHitKiller to deathList[1]
function onDeath(cid, corpse, deathList[1], mostDamageKiller)local cidpos = getPlayerPosition(deathList[1])loot = 5943Change lastHitKiller[1] and lastHitKiller to deathList[1]
i gave up !! affi dont need it -.-!!!!!
function onDeath(cid, corpse, deathList)
if isPlayer(deathList[1]) then
local item = doAddContainerItem(corpse.uid, 5943, 1)
doItemSetAttribute(item, "description", "This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".")
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".")
doSendMagicEffect(getPlayerPosition(deathList[1]), CONST_ME_MAGIC_BLUE)
end
return true
end
i'm very sorry but still not workingCode:function onDeath(cid, corpse, deathList) if isPlayer(deathList[1]) then local item = doAddContainerItem(corpse.uid, 5943, 1) doItemSetAttribute(item, "description", "This is the heart of "..getPlayerName(cid).." killed at Level "..getPlayerLevel(cid).." by "..getPlayerName(deathList[1])..".") doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_CONSOLE_ORANGE, "You Killed " .. getCreatureName(cid) .. ".") doSendMagicEffect(getPlayerPosition(deathList[1]), CONST_ME_MAGIC_BLUE) end return true end