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

How can i broadcast message if someone kills monster with name X

Tbol

Well-Known Member
Joined
Apr 7, 2019
Messages
526
Reaction score
54
Hi
how can i broadcast message if someone kills monster lets say with name "Dick Lord" and once this monster is killed it would say "Dick Lord was killed"

tfs 1.2
 
Solution
If it is registered in the monster, it should send the message although any statements.
Remove all lines except broadcastMessage.
Already set the message to something as you said "dick is dead" etc without these functions inside.
That’s a very clever monster name.

Code:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
local playerName = deathList[1]
   if getCreatureName(cid) == 'Mutated Squirrel' then
     broadcastMessage("The player "..getCreatureName(playerName).." killed ".. getCreatureName(cid) ..". Congratulations.")
   end
   return true
end
not sure about cid tho
 
Code:
function onDeath(player, corpse, killer, mostDamage, unjustified, mostDamage_unjustified)
local playerName = deathList[1]
   if getCreatureName(cid) == 'Mutated Squirrel' then
     broadcastMessage("The player "..getCreatureName(playerName).." killed ".. getCreatureName(cid) ..". Congratulations.")
   end
   return true
end
not sure about cid tho
Replace that monster name with yours.
 
If it is registered in the monster, it should send the message although any statements.
Remove all lines except broadcastMessage.
Already set the message to something as you said "dick is dead" etc without these functions inside.
 
Solution
If it is registered in the monster, it should send the message although any statements.
Remove all lines except broadcastMessage.
Already set the message to something as you said "dick is dead" etc without these functions inside.
Damn nice, didnt knew that
 
Back
Top