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

Solved Problem with creaturescript onDeath

Tuchol

falania.com
Joined
Nov 21, 2008
Messages
387
Reaction score
13
Location
Uzbekistan
Hello guys,
I have a little problem with my code ...when i kill the monster broadcast show
Code:
19:37 The player Mutated Squirrel killed Mutated Squirrel. Congratulations.
but it will be Player name not name of monster.. i Have tfs 0.4...
This is code
Code:
function onDeath(cid, corpse ,killer)
local PlayerName = getPlayerName(lastHitKiller)
if getCreatureName(cid) == 'Mutated Squirrel' then
broadcastMessage("The player "..getCreatureName(cid).." killed Mutated Squirrel. Congratulations.")
end
return TRUE
end
Thanks for help :)
 
Code:
broadcastMessage("The player "..getCreatureName(killer).." killed Mutated Squirrel. Congratulations.")
 
for what these nerves StreamSide?
Code:
[19:59:25.425] [Error - CreatureScript Interface]
[19:59:25.425] data/creaturescripts/scripts/squirrel.lua:onDeath
[19:59:25.425] Description:
[19:59:25.426] (luaGetCreatureName) Creature not found

[19:59:25.426] [Error - CreatureScript Interface]
[19:59:25.426] data/creaturescripts/scripts/squirrel.lua:onDeath
[19:59:25.427] Description:
[19:59:25.427] (luaGetCreatureName) Creature not found

[19:59:25.427] [Error - CreatureScript Interface]
[19:59:25.427] data/creaturescripts/scripts/squirrel.lua:onDeath
[19:59:25.428] Description:
[19:59:25.428] data/creaturescripts/scripts/squirrel.lua:4: attempt to concatenate a boolean value
[19:59:25.428] stack traceback:
[19:59:25.428]  data/creaturescripts/scripts/squirrel.lua:4: in function <data/creaturescripts/scripts/squirrel.lua:1>
 
Code:
function onDeath(cid, corpse, deathList)
local playerName = deathList[1]
   if getCreatureName(cid) == 'Mutated Squirrel' then
     broadcastMessage("The player "..getCreatureName(playerName).." killed ".. getCreatureName(cid) ..". Congratulations.")
   end
   return true
end
 
Back
Top