--[[ MrFaul wire_doorcontroller Spawner V 1.0 ]] --Enter here the Prefix for searching findfix = "wdc" function CreateController( model,pos,angles,target) local ent = ents.Create("wire_door_controller") if (!ent:IsValid()) then return end ent:SetModel(model) ent:SetPos(pos) if(angles != nil) then ent:SetAngles(angles) end ent:Spawn() ent:Activate() local id= ent:EntIndex() ent:TheDoor(id,target) end function SearchForController() local research = ents.FindByName(findfix) for i, prop in pairs(research) do if(prop:IsValid())then local target = prop:GetKeyValues().target local oriant = prop:GetAngles() if(target != nil) then CreateController(prop:GetModel(),prop:GetPos(),oriant,target) prop:Remove() end end end end concommand.Add("make_controller", SearchForController)