ENT spawnpos Help

hello there i have created a script where you can go… /withdraw <amount>

but for somereason it spawns on me and not the Ent so if you could help that would be great…

Here The Code

[lua]AddCSLuaFile( “cl_init.lua” ) // Make sure clientside
AddCSLuaFile( “shared.lua” ) // and shared scripts are sent.
include(‘shared.lua’)

function ENT:Initialize()
util.PrecacheSound(“common/wpn_hudoff.wav”)
util.PrecacheSound(“items/ammo_pickup.wav”)
util.PrecacheSound(“common/null.wav”)
self.Entity:SetModel( “models/props_c17/oildrum001.mdl”)
– self.Entity:SetModel( “models/props_junk/metalgascan.mdl”)
self.Entity:PhysicsInit( SOLID_VPHYSICS ) // Make us work with physics,
self.Entity:SetMoveType( MOVETYPE_VPHYSICS ) // after all, gmod is a physics
self.Entity:SetSolid( SOLID_VPHYSICS ) // Toolbox
local phys = self.Entity:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end
self.max = 15 --max number of items per pack, fiddle with this all you like

-- LEAVE ALONE!
self.contains = {}	
self.used = false
self.pickedup = false
self.player = nil
self.touched = false
self.Entity:SetNetworkedInt( "number", 0 )

end

function ENT:SpawnFunction( ply, tr )

if ( !tr.Hit ) then return end

local SpawnPos = tr.HitPos + tr.HitNormal * 16

local ent = ents.Create( "sent_backpack" )
ent:SetPos( SpawnPos )
ent:Spawn()
ent:Activate()
return ent

end

–for getting things in and out of, currently you can do this while it’s on someones back.
function ENT:Use(activator)
if (!self.used) then
local Pp = 100
local p = self.Entity:GetNetworkedInt( “number”)
if (p > 0) then
if p < Pp then Pp = p end
p = p - Pp
self.Entity:SetNetworkedInt( “number”, p )
local ang = self.Entity:GetAngles()
local SpawnPos = self.Entity:GetPos() + self.Entity:GetForward() * -20
SpawnPos.z = SpawnPos.z + 70
DarkRPCreateMoneyBag(SpawnPos, Pp)
self.used = true
timer.Simple(3.3,unuse,self)
local ent = ents.Create( self.contains[1].class )
ent:SetModel(self.contains[1].model)
–ent:SetPos( SpawnPos )
–ent:SetAngles(ang)
–ent:Spawn()
–ent:Activate()
self.contains[1].tab.Entity = ent
ent:SetTable(self.contains[1].tab)
table.remove(self.contains,1)
local phys = ent:GetPhysicsObject()
if (phys:IsValid()) then
phys:Wake()
end

end
end
end

function unuse(self)
self.used = false
end
— withdraw command
local function withdraw(self, args)
if args == “” then return “” end
if not tonumber(args) then
return “”
end
local p = self.Entity:GetNetworkedInt( “number”)
local amounts = math.floor(tonumber(args))
if p < amounts then amounts = p end
p = p - amounts
local ang = self.Entity:GetAngles()
local SpawnPos = self.Entity:GetPos() + self.Entity:GetForward() * -20
SpawnPos.z = SpawnPos.z + 70
DarkRPCreateMoneyBag(SpawnPos, amounts)
self.Entity:SetNetworkedInt( “number”, p )
return “”
end
AddChatCommand("/withdraw", withdraw)

–Put things into it with the physics gun, or pick it up by walking into it
function ENT:Touch(activator)

if (!self.touched) then

	local p = self.Entity:GetNetworkedInt( "number")
	local r = activator:GetClass()
	if (activator:IsPlayerHolding( )) and (p &lt; self.max) then

		local m = activator:GetModel()
		if (util.IsValidModel(m)) then
			local g = {}
			if activator:GetClass() == "spawned_money" then g.class = r else return end
			g.model = m
			g.tab = activator:GetTable()

			local en = activator
			local total = 0

			-- Just use en, you don't need any loops here
			if en.GetTable and en:GetTable().moneybag and en:GetTable().dt.amount then

				total = total + en:GetTable().dt.amount

			elseif en:GetClass() == "spawned_money" and en.dt.amount then

				total = total + en.dt.amount

			end

			table.insert(self.contains, g)
			activator:Remove()
			p = total
			total = p
			self.Entity:SetNetworkedInt( "number", p )
			self.touched = true
			timer.Simple(0.3,untouch,self)

	else

		--play error sound if the model doesn't work, it happens sometimes but this way we don't loose the prop or get an annoying error marker
		self.Entity:EmitSound( "common/null.wav", 500, 100 )

	end

	elseif (p == self.max) then

		self.Entity:EmitSound( "common/null.wav", 500, 100 )

	end

	if (activator:IsPlayer()) then

		local a = ents.FindByClass("sent_backpack")
		local found = false
		local n = nil
		for k,v in ipairs(a) do

		if (v.player == activator) then

			found = true

		end

	end

	if (!found) then  end

	end

end

end

function untouch(self)

self.touched = false

end

[/lua]

Btw Ther eis no errors just the problem it spawing on me insted of the ent

Thx For Ur Time