I'm retarded and can't my entity to spawn

init.lua
[lua]AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)

include(‘shared.lua’)

print(“Soda Machine Detected”)

function ENT:SpawnFunction(ply, tr)

print( "SpawnFunction fired." )
if (!tr.HitWorld) then return end

local ent = ents.Create("ent_sodamachine") 
ent:SetPos(tr.HitPos + Vector(0, 0, 50)) 
ent:Spawn()
ent:Activate()

return ent 

end

function ENT:Initialize()

print("Initilize firing.")
self.Entity:PhysicsInit( SOLID_VPHYSICS )
self.Entity:SetMoveType( MOVETYPE_VPHYSICS )
self.Entity:SetSolid( SOLID_VPHYSICS )
self.Entity:SetModel( "models/props_interiors/VendingMachineSoda01a.mdl" )

local phys = self.Entity:GetPhysicsObject();
if (phys:IsValid()) then
	phys:Wake();
end

end[/lua]

cl_init.lua
[lua]include(‘shared.lua’)

function ENT:Draw()

print("Draw fired.")
self.Entity:DrawModel()

end[/lua]

shared.lua
[lua]ENT.Type = “anim”
ENT.Base = “base_gmodentity”

ENT.Category = “Roleplay Entities”
ENT.PrintName = “Breen Soda Dispenser”
ENT.Author = “Namaste”
ENT.Purpose = “I poop out bottles of water.”
ENT.Instructions = “Spawnable by admins. Saves to map.”

ENT.Spawnable = false
ENT.AdminSpawnable = true[/lua]

So, I go into sandbox and click my entity. It doesn’t show up, and no errors come up… What the heck?

Clear your console start a server then do a condump and post it here

[editline]08:50PM[/editline]

And where are you saving it?

I’m saving it in the Sandbox’s Entities folder. The console prints “Soad Machine Detected” when my game loads. However, it won’t print anything when I click the spawn icon. It’s detecting it, just won’t spawn it.

Is your entities folder name ent_sodamachine.

On line 13. it must be your entities folder name.

It is.

line 30 add
self.Entity:Spawn()

No…

If fixed it. Was a really dumb error on my part. Launching the wrong gamemode harrrr…

-snip-

It works as expected, however the sounds don’t play. I get this error in my console.



Failed to load sound "sound\ambient\office\coinslot1.wav", file probably missing from disk/repository
Failed to load sound "sound\buttons\button4.wav", file probably missing from disk/repository

[editline]04:58PM[/editline]

Nevermind. Fixed it. Root folder for sounds is sound.