1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Sign up for news, events and more!

    You're currently visiting the official DarkRP Forums as a guest. Sign up now to participate in our community and we'll let you know when we have news.

Please tell me if this is the right hook. If not which is the correct one?

Discussion in 'Modder General Chat' started by [SUP] Donny Dealer, Oct 29, 2019.

  1. [SUP] Donny Dealer

    [SUP] Donny Dealer New Member

    I have been learning LUA over the past few days to make this feature. Once a player kills a NPC it will trigger a ULX command through RunConsoleCommand that alerts other players of an event.

    I have finally gotten something that works, except I believe I am using the wrong hook. When I user PlayerSay it works fine... But OnNPCKilled may be the wrong hook, It doesn't seem to be detecting that a NPC is killed.

    hook.Add( "OnNPCKilled", "Minigame", function (npc, attacker, inflictor)
    if attacker:IsPlayer() then
    RunConsoleCommand( "ulx csay There are leeches around... Kill them for a reward." )

Share This Page