Hi. I’m having a little problem here. I was wondering if anyone is able to assist me in this. i’ve been trying to find a fix for it for just a bit now, and I couldn’t find a way to get this to work.
Any type of help would be well appreciated. It crashes my server on startup. But it works fine when I add “Createnpc(blah,blah,blah)” while the server’s up.
function createnpc(entity,position,health) local createnpc = ents.Create( entity ) if ( !IsValid( createnpc ) ) then return end // Check whether we successfully made an entity, if not - bail createnpc:SetPos( position ) createnpc:Spawn() createnpc:SetHealth(health) end createnpc("npc_antlion",Vector(-1258.724121, -1560.611328, -139.968750),100)