Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pressing "use" to non props/entities with enabled "use protection" causes script error #1

Open
Pollitto opened this issue Jul 10, 2018 · 1 comment

Comments

@Pollitto
Copy link

Pollitto commented Jul 10, 2018

If you enable "use protection" and try to click to the air/walls/floor (not props or entities) you will get
14:20:07 [ERROR] addons/nadmodpp/lua/autorun/server/nadmod_pp.lua:246: attempt to index a nil value 1. fn - addons/nadmodpp/lua/autorun/server/nadmod_pp.lua:246 2. unknown - addons/ulib/lua/ulib/shared/hook.lua:109
The reason of this error is NADMOD.Props[ent:EntIndex()].Name. For some reason ent = player that tried to use.
So the solution is add and !ent:IsPlayer() before NADMOD.Props[ent:EntIndex()].Name to check if the ent is not equals player.

Full fixed 246 line:

if !NADMOD.PPConfig["use"] or NADMOD.PlayerCanTouch(ply, ent) or (ent:IsValid() and !ent:IsPlayer() and NADMOD.Props[ent:EntIndex()].Name == "W") then
@sammyt291
Copy link
Contributor

Cant seem to replicate this with latest versions.
@Pollitto still getting this error?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants