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

CreatureScript Help

Zie

New Member
Joined
Jun 7, 2009
Messages
26
Reaction score
0
in BcAnyoneDied.lua i wrote:

Code:
function onDeath(cid, target)
        if isPlayer(target) == TRUE then
                broadcastMessage(""..getCreatureName(target).." killed "..getCreatureName(target).." ["..getPlayerLevel(cid).."]", MESSAGE_STATUS_WARNING) 
        end
        return TRUE 
end

in login.lua i wrote:
registerCreatureEvent(cid, "BcAnyoneDied")

in creaturescripts.lua i wrote:
<event type="death" name="BcAnyoneDied" script="BcAnyoneDied.lua"/>
I am trying to get a script that will broadcast whenever a player dies by a monster. The code above does not do anything when I have it on server...Thanks for any help!

P.S. TFS Version 0.2.3 (Mystic Spirit)
 
Last edited:
First of all, replace the content in BcAnyoneDied.lua with the following:

Lua:
function onKill(cid, target)

	if isPlayer(target) == TRUE then
		broadcastMessage(""..getCreatureName(cid).." killed "..getCreatureName(target).." ["..getPlayerLevel(target).."]", MESSAGE_STATUS_WARNING) 
	end
	return TRUE 

end

then replace the line in your creaturescripts.lua with the following:

PHP:
<event type="kill" name="BcAnyoneDied" script="BcAnyoneDied.lua"/>
 
First of all, replace the content in BcAnyoneDied.lua with the following:

Lua:
function onKill(cid, target)

	if isPlayer(target) == TRUE then
		broadcastMessage(""..getCreatureName(cid).." killed "..getCreatureName(target).." ["..getPlayerLevel(target).."]", MESSAGE_STATUS_WARNING) 
	end
	return TRUE 

end

then replace the line in your creaturescripts.lua with the following:

PHP:
<event type="kill" name="BcAnyoneDied" script="BcAnyoneDied.lua"/>



I did this all and when character dies, it does not broadcast... and no errors either...
 
Back
Top