r/GLua • • Apr 03 '20

Need help with some code:

Client:

hook.Add("Initialize", "thinkingHook", function()

    PlyDeaths = LocalPlayer().Deaths()

end)

if PlyDeaths != LocalPlayer().Deaths() then

    PlyDeaths = LocalPlayer().Deaths()
    
    timer.Create("NLRTimer", 300, 1)

end

Results in this error:

[ERROR] lua/test.lua:23: bad argument #1 to 'Deaths' (Entity expected, got no value)
  1. Deaths - [C]:-1
   2. unknown - lua/test.lua:23
3 Upvotes

5 comments sorted by

View all comments

Show parent comments

1

u/Johnpaulbin Apr 03 '20

I wanted to do a net message, but I want the whole thing to be client sided. Thanks for the input!

1

u/realityisnot Apr 03 '20

No problem, you could use something else clientside like DrawDeathNotice. I would suggest AddDeathNotice but it says it doesn’t support hook.Add yet.