• LUA Error: attempt to call method 'Ignite' (a nil value)
    4 replies, posted
Hi, fellow LUA developers, I keep getting this LUA error in my development server console: [CODE][ERROR] addons/ion guns/weapons/jamie_ion_pistol/shared.lua:92: attempt to call method 'Ignite' (a nil value) 1. unknown - addons/ion guns/lua/weapons/jamie_ion_pistol/shared.lua:92[/CODE] Are there any methods towards resolving this? Or is it an error best not tampered with? Thanks in advance, Jamie
It would be very helpful if you post line 80-100 from the shared.lua so we can take a look at the code.
Sounds like you're trying to call [B][URL="http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexc61b.html"]Ignite[/URL][/B] on something that isn't an entity. But yeah, just the error won't help fix the issue, we need the code segment which is causing this.
Or you are trying to call Ignite on client.
Hi guys, I managed to fix this! Turns out I was calling Ignite in shared, and not in server. So, I wrapped it like this: [CODE] if SERVER then if trace.HitNonWorld then target = trace.Entity target:Ignite(10) if target:IsPlayer() or target:IsNPC() then target:Ignite(10) end end end[/CODE] It works just fine!
Sorry, you need to Log In to post a reply to this thread.