ULX

Author Topic: How would I write this to ulx?  (Read 1596 times)

0 Members and 1 Guest are viewing this topic.

Offline awesomenessispure

  • Newbie
  • *
  • Posts: 9
  • Karma: -7
How would I write this to ulx?
« on: September 05, 2014, 01:15:08 PM »
Is there a way to add something in ulx like this so in ulx there is a "suicide" button I have been using this code!

hook.Add("OnPlayerChat", "!kill", function(player, text, TeamOnly, dead)
if text:lower():sub(1,4) == "!kill" then
if player == LocalPlayer() then
LocalPlayer():ConCommand("kill")
end
return true
end
end)

Offline Caustic Soda-Senpai

  • Sr. Member
  • ****
  • Posts: 469
  • Karma: 54
  • <Insert something clever here>
    • Steam Page
Re: How would I write this to ulx?
« Reply #1 on: September 07, 2014, 10:51:34 AM »
why?
Once you get to know me, you'll find you'll have never met me at all.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How would I write this to ulx?
« Reply #2 on: September 08, 2014, 05:03:00 AM »
bind <key_letter_you_want_to_use> kill

No lua needed.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming