Olá pessoal, esse script funciona quando algum player morre para outro player, assim aparecendo uma mensagem para todos do servidor falando quem morreu e quem matou.

Primeiramente em creaturescripts.xml adicione a seguinte linha:

<event type="kill" name="Anunciar_Mortes" script="anunciar_morte.lua"/>

Pós adicionar, crie um arquivo com o nome de anunciar_morte.lua e coloque dentro da pasta creaturescripts/scripts com o seguinte conteúdo:

 

código TFS 1.0:

  Ocultar conteúdo
function onKill(cid, target)

	if isPlayer(cid) and isPlayer(target) then
		broadcastMessage(getCreatureName(target).."["..getPlayerLevel(target).."] acabou de ser morto pelo jogador "..getCreatureName(cid).."["..getPlayerLevel(cid).."].", MESSAGE_EVENT_ADVANCE)
	end

	return true
end

 

código TFS 1.1:

  Ocultar conteúdo
function onKill(creature, target)

	if isPlayer(creature) and isPlayer(target) then
		broadcastMessage(getCreatureName(target).."["..getPlayerLevel(target).."] acabou de ser morto pelo jogador "..getCreatureName(creature).."["..getPlayerLevel(creature).."].", MESSAGE_EVENT_ADVANCE)
	end

	return true
end 

 

E por fim vá até creaturescripts/scripts e abra seu login.lua, antes do ultimo return true adicione a seguinte linha:

creature:registerEvent("Anunciar_Mortes")

LEAVE A REPLY

Please enter your comment!
Please enter your name here