???Because killer does not exist in the function, read what I wrote above.
function onDeath(cid, corpse, deathList)
if isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_WARNING, "dfdfdfdf")
end
return true
end
there any function to check corpse for monster because i use onkill but need reward add in corpse not send to player
tfs 0.4
f5
function onDeath(cid, corpse, deathList)
something like this wont workUse onDeath;
global860/creatureevent.cpp at 571183a2858e638d49778cca914c8126bd6f17ce · otservme/global860 · GitHubLua:function onDeath(cid, corpse, deathList)
remove isplayer(cid)something like this wont work
function onDeath(cid, corpse, deathList)
if isPlayer(cid) and isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
end
return true
end
yes workedremove isplayer(cid)
yes i did but i need to send msg to player he killed the monster and own loot when useThat's not all you have to do. You also need to add the event to the monster_name.xml
function onDeath(cid, corpse, killer)
if isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
doPlayerSendTextMessage(killer[1], MESSAGE_STATUS_WARNING, "dfdfdfdf")
end
return true
end
not work error 'killer' <a nil value >Lua:function onDeath(cid, corpse, killer) if isMonster(cid) then doAddContainerItem(corpse.uid, 2151, 1) doPlayerSendTextMessage(killer[1], MESSAGE_STATUS_WARNING, "dfdfdfdf") end return true end
function onDeath(cid, corpse, killer)
if isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
if isPlayer(killer.uid) then
doPlayerSendTextMessage(killer.uid, MESSAGE_STATUS_WARNING, "dfdfdfdf")
end
end
end
same error :SLua:function onDeath(cid, corpse, killer) if isMonster(cid) then doAddContainerItem(corpse.uid, 2151, 1) if isPlayer(killer.uid) then doPlayerSendTextMessage(killer.uid, MESSAGE_STATUS_WARNING, "dfdfdfdf") end end end
Lua:function onDeath(cid, corpse, killer) if isMonster(cid) then doAddContainerItem(corpse.uid, 2151, 1) if isPlayer(killer.uid) then doPlayerSendTextMessage(killer.uid, MESSAGE_STATUS_WARNING, "dfdfdfdf") end end end
same error :S
function onDeath(cid, corpse, deathList)
if isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
end
return true
end
???Because killer does not exist in the function, read what I wrote above.
function onDeath(cid, corpse, deathList)
if isMonster(cid) then
doAddContainerItem(corpse.uid, 2151, 1)
doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_WARNING, "dfdfdfdf")
end
return true
end
worked???
My script should work.. After you have added everything you need to restart the server.
You can also try this:
Lua:function onDeath(cid, corpse, deathList) if isMonster(cid) then doAddContainerItem(corpse.uid, 2151, 1) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_WARNING, "dfdfdfdf") end return true end
Maybe a small "thank you" for this guy that helped you?worked
Use onDeath;
global860/creatureevent.cpp at 571183a2858e638d49778cca914c8126bd6f17ce · otservme/global860 · GitHubLua:function onDeath(cid, corpse, deathList)
???
My script should work.. After you have added everything you need to restart the server.
You can also try this:
Lua:function onDeath(cid, corpse, deathList) if isMonster(cid) then doAddContainerItem(corpse.uid, 2151, 1) doPlayerSendTextMessage(deathList[1], MESSAGE_STATUS_WARNING, "dfdfdfdf") end return true end
tfs 0.4
I doesn't really matter. It's just a variable name, it should work however named it is. It's probably still the same rev you are revering to, but the script in question most likely got copied or based on already existing 1.x one that's where the variable name "killer" got there in the first place.I just checked the source code (link above) and 0.4 dosn't seem to have "killer", but maybe you are running another rev?
The error also said it was related to killer.
I doesn't really matter. It's just a variable name, it should work however named it is. It's probably still the same rev you are revering to, but the script in question most likely got copied or based on already existing 1.x one that's where the variable name "killer" got there in the first place.
@Topic
Not really familiar with 0.4, but you should try killing something with your summon and see if it doesn't throw out an error. Simple isPlayer(deathList[1]) check will fix it. In 1.x doPlayerSendTextMessage() checks for a player, not sure how it is in 0.4.