Eyo, just need some help
[ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:101: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:101
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
is the error I'm getting.
local radius = LocalPlayer():GetPos():Distance(v:GetPos()) Thats the line, any help will be great.
[QUOTE=kojio600;42343909]Eyo, just need some help
[ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:101: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:101
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
is the error I'm getting.
local radius = LocalPlayer():GetPos():Distance(v:GetPos()) Thats the line, any help will be great.[/QUOTE]
The full code would be better, as a note.
The error is saying you fed it a bad entity. I'm going to guess you didn't define v, or it was removed.
-ninja'd-
[QUOTE=kojio600;42343909]Eyo, just need some help
[ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:101: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:101
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
is the error I'm getting.
local radius = LocalPlayer():GetPos():Distance(v:GetPos()) Thats the line, any help will be great.[/QUOTE]
I think it would have something to do with that LocalPlayer function (that never works for me >.>) or you did your for, do loop wrong. Or this monstrosity:
[CODE]local radius = LocalPlayer():GetPos():Distance(v:GetPos())[/CODE]
If you want a better radius use this:
[CODE]Distance = math.Round((LocalPlayer():GetPos() - v:GetPos()):Length())[/CODE]
I'll try the Distance one, but heres the whole code. [url]http://pastebin.com/a9tDmu2w[/url]
[editline]29th September 2013[/editline]
The distance make sthis [ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:102: attempt to compare nil with number
1. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:102
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
[QUOTE=kojio600;42344034]I'll try the Distance one, but heres the whole code. [url]http://pastebin.com/a9tDmu2w[/url]
[editline]29th September 2013[/editline]
The distance make sthis [ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:102: attempt to compare nil with number
1. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:102
2. unknown - addons/ulib/lua/ulib/shared/hook.lua:183[/QUOTE]
That's the next line, [lua]if radius <= 250 then[/lua]
Change this to
[lua]if Distance <= 250 then[/lua]
[ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:101: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:101
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
I still get this error, it's when the player leaves when they have the nlr timer.
[QUOTE=kojio600;42352442][ERROR] addons/nlr timer/lua/autorun/nlrtimer.lua:101: Tried to use a NULL entity!
1. GetPos - [C]:-1
2. fn - addons/nlr timer/lua/autorun/nlrtimer.lua:101
3. unknown - addons/ulib/lua/ulib/shared/hook.lua:183
I still get this error, it's when the player leaves when they have the nlr timer.[/QUOTE]
You need to add a hook for when the player disconnects to remove the timer.
-Edit
Also, add a line that checks to see if the player is valid.
I'm really not sure how to do that, can I have some help?
Well, since PlayerDisconnected is a SERVER hook ( In case you're doing anything client-side ), at the top of the function in your timer.Create, if !IsValid( player ) then remove the timer.
Removing the timer is done via: timer.Destroy( "TimerName" );
So where would I place this?
I think its safe to assume the code he's having problems with ISN'T his, and if you don't provide us anything to work with you can't expect people to be able to solve your issue.
I never stated the code was "mine" and I gave you the code? [url]http://pastebin.com/a9tDmu2w[/url]
Sorry, you need to Log In to post a reply to this thread.