Alright, so earlier I posted a thread asking how to run a function when two props came into contact with each other. One of the answers was to make an entity and use the ENT:Touch function.
So I did. I know it is running because if I do this:
function ENT:Touch( sinep ) if sinep:IsPlayer() then sinep:Kill() end end
and it works. If I use a more complicated code, it doesn’t do shit. I am trying to make it come in contact with a box, delete the box, and create a bath tub. This is my code:
function ENT:Touch( sinep ) if ( sinep:GetModel() == "models/Items/item_item_crate.mdl" ) then local kcid = ents.Create( "prop_physics" ) kcid:SetModel( "models/props_interiors/BathTub01a.mdl" ) kcid:SetPos( Vector( 0, 0, 50 ) ) kcid:Spawn() sinep:Remove() end end
If you can help educate me on how to make this work, then thank you VERY much!