Whenever i try to spawn my NPC i get this: Tried to use a NULL entity!

Attempted to create unknown entity type OCDM_WeaponNPC!
Hook ‘Spawnnpcs’ Failed: [@gamemodes\ocdm\gamemode\init.lua:248] Tried to use a NULL entity!
^ Is the error i get when my NPC spawn (Keep in mind its a shop NPC)

Here is the code for line 248:
[lua]
NPC:SetPos(Vector(-558, -1367, -66));
[/lua]
And here is the entire NPC spawn code:
[lua]
function SpawnNPCs()
local NPC = ents.Create(“OCDM_WeaponNPC”);
NPC:SetPos(Vector(-558, -1367, -66));
NPC:SetAngles(Angle(2, 43, 0));
NPC:Spawn();
end
hook.Add( “InitPostEntity”, “Spawnnpcs”, SpawnNPCs)
[/lua]

This started after the GMod update. I really hope someone can provide me a fix for this problem.

Thank you in advanced!

It’s the capitol letters.

I tryed chaning Spawnnpcs to SpawnNPCs, and it still gives me the error:


Attempted to create unknown entity type OCDM_WeaponNPC!
Hook 'SpawnNPCs' Failed: [@gamemodes\ocdm\gamemode\init.lua:248] Tried to use a NULL entity!

Is there any other place where im typing something wrong?

ents.Create can’t use anything other than lowercase characters now.

I think you have to change the folder name to lower case also.

EDIT* Oh nevermind, you didn’t understand what I was talking about. Yeah what portal said, change this OCDM_WeaponNPC, to this ocdm_weaponnpc . Not sure if you will have to make the folder lowercase or not.

Well i only understood that you wanted me to change the letters to match :wink: Well now i know what you where talking about. Thank you.