• Creating a Valid entity
    3 replies, posted
The error I have no idea where to start with this error ;-; [CODE] Attempted to create unknown entity type i_item! false [ERROR] addons/inventory/lua/autorun/nocturnalinventory/libraries/core/sv_init.lua:28: Tried to use a NULL entity! 1. SetPos - [C]:-1 2. SpawnItem - addons/inventory/lua/autorun/nocturnalinventory/libraries/core/sv_init.lua:28 3. unknown - addons/inventory/lua/autorun/nocturnalinventory/libraries/core/items.lua:81 4. unknown - lua/includes/modules/concommand.lua:54 [/CODE] The attempt to create the entity [CODE] local meta = FindMetaTable("Player") function meta:SpawnItem( item ) if(Inventory.Items.Stored[item])then local tr = self:EyeTrace(100) local entItem = ents.Create("i_item") print(entItem:IsValid()) entItem:SetPos(tr.HitPos) entItem.Unique = item entItem.Model = item.Model entItem:Spawn() else print("No item registered as: "..item) end end [/CODE] The Eyetrace function [CODE] function meta:EyeTrace( dis ) local tr = {} tr.start = self:GetShootPos() tr.endpos = tr.start + (self:GetAimVector() * dis) tr.filter = self tr = util.TraceLine(tr) return tr end [/CODE]
i_item is an non existing item, and has to be coded yet.
[QUOTE=whitestar;48769372]i_item is an non existing item, and has to be coded yet.[/QUOTE] I figured that and thats why im asking for help
[QUOTE=DiscoKnight;48769458]I figured that and thats why im asking for help[/QUOTE] I dont know how the database works, try creating an dummy entity which does nothing.
Sorry, you need to Log In to post a reply to this thread.