Bed Sent Help

How would i make the mattress ragdoll attached to this SENT?

[lua]AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(‘shared.lua’)

function ENT:Initialize()
self.Entity:SetModel(“models/props_c17/FurnitureBed001a.mdl”)
self.Entity:PhysicsInit(SOLID_VPHYSICS)
local phys = self.Entity:GetPhysicsObject()
if(phys:IsValid()) then phys:Wake() end
end

function ENT:Think()
end

function ENT:PhysicsCollide(data, phys)
end

function ENT:Touch( activator )
if activator:IsPlayer() then
if activator:GetSleep()>0 then
activator:TakeSleep(0.05)
end
if activator:GetSleep()<0 then activator:SetSleep(0) end
end
end[/lua]

Cheapest and easiest way to do it :
[lua]AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(‘shared.lua’)

function ENT:Initialize()
self:SetModel(“models/props_c17/FurnitureBed001a.mdl”)
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()

if phys and phys:IsValid() then phys:Wake() end

local mattress = ents.Create("prop_dynamic")
mattress:SetModel("models/props_c17/FurnitureMattress001a.mdl")
mattress:SetPos(self:GetPos() + Vector(0,0,-5))
mattress:SetParent(self)
mattress:Spawn()
self:DeleteOnRemove(mattress)

end

function ENT:Think()
end

function ENT:PhysicsCollide(data, phys)
end

function ENT:Touch( activator )
if activator:IsPlayer() then
if activator:GetSleep()>0 then
activator:TakeSleep(0.05)
end
if activator:GetSleep()<0 then activator:SetSleep(0) end
end
end[/lua]

The mattress won’t have collisions and won’t be a ragdoll though, but that’s well because people on it will trigger the Touch hook.

You’re the best person ever. :tiphat:

or you can just use this model: models/props/de_inferno/bed.mdl

I’m trying to avoid CSS Props.