A message appears in the middle of the screen
Neymar killed jason (Messi)
Scripts
Kill message Script
Kill message Script
1

addhook("kill", "_kill")
function _kill(id, victim, weapon, x, y)
	if player(victim, "team") == 1 and player(id, "team") == 2 then
		msg("Neymar killed jason (Messi)@C");
	end
end
THEMUD: Neymar and Messi are only examples. function die_(victim, killer)
msg(string.char(169).."255255255Player named "..player(victim, "name").." has been killed by "..player(killer, "name").." @C")
end
addhook("die","die_")
die instead of kill but it does the same effect. addhook("kill","killmsg")
function killmsg(k,v)
	if k ~= nil and v ~= nil and k ~= v and v ~= k then
		msg("\169192192192"..player(k,"name").." killed "..player(v,"name"))
	end
end
Mami Tomoe: Dunno why you defined killer and victim as opposite to nil, but you forgot to make it appear in the middle of the screen in your msg parameter.
GeoB99: Actually for the
die hook, you have to also check if the "killer" is actually a player that exists or not (A simple killer > 0 check will do), as I don't think player(0,"name") has a value.
die has written
kill hook is better for this scenario because you can bypass this check completely.
Cure Pikachu: Oh yeah, I didn't actually pay lots of attention about this. Often, I used
die than kill since it does same effect though it can also leads to unexpected behaviours if a player wasn't killed by an enemy.
1
