how can i fix it? my first time on lua coding im learning to code
Scripts
It Shows Everyone!
It Shows Everyone!
1

msg2(id,"<message>")
addhook("die","firstlua")
function firstlua()
msg2(id,"©255000000You Died!")
msg2(id,"©255000000Wait For Next Round.")
end
----END----
function firstlua(id)
victimas
die hook doesn't pass such arguments like idnatively, unless you manually retrieve that value by iterating over living players. Therefore id must be replaced with victim inside the two
msg2()functions as well.
GeoB99: You know the parameters count only the order, rather than the actual name right?
_Vipersiax: Consider hooks as event that occurs at a specific time.
GeoB99 said,We can use any term to refer those parameters for any hooks.addhook("die","death")
function death(asshole)
msg2(asshole,"Rest in peace")
end
-- Start --
addhook("die","player_dieMsg")
function player_dieMsg(victim,killer)
	msg2(victim,"Get rekt noob!!!")
	msg2(victim,"You got owned by "..killer.."!!!")
end
-- End --
baRD: That looks fine, apart from "..killer.."will display the ID instead of the name.
msg2(victim,"You got owned by "..killer(id,"name").."!!!")
baRD: You use the
player function to retrieve player information, so it will always be player(id, value)
killerand the value we want to retrieve is
name:
player(killer, "name")
1
