• [GMOD] [Support] Script Errors with cl_init.lua Line 82
    9 replies, posted
I was playing on vessel (can provide link to map if needed), and as a body dropped, I landed to ID it and I was faced with these errors [IMG]http://puu.sh/hvSMO/21f9afc4ce.png[/IMG] Any ideas?
That means the view model doesn't have an attachment. Do a validity check on the attachment
Don't know lua. How would I do this? Tried looking it up, and it seems I may have to include some type of "Entity/IsValid" or "Global/IsValid"? [url]http://wiki.garrysmod.com/page/Entity/IsValid[/url] [url]http://wiki.garrysmod.com/page/Global/IsValid[/url] Thanks for the quick response.
[code]if not IsValid( attachment ) then ... end[/code] Either return or go to the next portion of the code
So at Line 83 I should add that bit you posted?
Yes, but replace the ... with what you want to do in there
I don't know WHAT I'm supposed to do in there lol Like I said, I'm not much of a coder. If you could point me to where I need to go.
[QUOTE=allofmywut;47638047]I don't know WHAT I'm supposed to do in there lol Like I said, I'm not much of a coder. If you could point me to where I need to go.[/QUOTE] Wrap StartPos = attachment.pos in and IsValid check like code_gs said
The problem occured with the same file again. This time I found a commonality. I noticed the errors occured when a player launched upwards with the grapple hook. Last time I faced the error, I was descending with the grapple hook. This specific error seems to call out the grapple hook and instead of calling out line 82, it's calling line 87 (both marked below). I have taken the above suggestions now and applied it. I'll reboot and see if I see the error happen again. New error: [IMG]http://puu.sh/hIrBp/d07cb277ee.png[/IMG] Current cl_init.lua: [IMG]http://puu.sh/hIsgW/3a1d62551a.png[/IMG] Hope I did this correctly. EDIT: Now I'm getting spammed with the below error in regards to line 88 of the above code. I am reverting back to the original. [IMG]http://puu.sh/hIsGX/1bf85fca1d.png[/IMG] EDIT 2: This model seemed to have fucked the grapple big time. The script error seems to not bve showing up anymore, although they were originally happening before I installed this model anyway. But for now Ill just wait it out. Cant seem to force it [url]http://steamcommunity.com/sharedfiles/filedetails/?id=389979292[/url]
Dunno if this will work, but replace lines 88 and 89 with: [lua] StartPos = Owner:GetAttachment(3) and Owner:GetAttachment(3).Pos or nil if !IsValid(StartPos) then return end [/lua]
Sorry, you need to Log In to post a reply to this thread.