Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. -- Let's start with the easy, most comman mode of deaths/kills - Weapon kills by other players.
  2. -- First get the root element, on damage of the player.
  3. rootElement = getRootElement()
  4. addCommandHandler("lastkilledby",
  5. -- once typed /lastkilledby, the player will be able to see who last damaged him, or if the knob damaged himself.
  6. if rootElement == player then
  7. function whoDamagedMe (thePlayer)
  8. local playerName = getPlayerName(thePlayer)
  9. -- now we know who damaged him, now output it.
  10. outputChatbox(playerName.." has damaged you!")
  11. end
  12. end
  13. addEventHandler("onClientPlayerDamage", rootElement, whoDamagedMe)
  14. else
  15. outputChatbox("You're a knob who just damaged himself.")
  16. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement