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:
[CODE]function ENT:Touch( sinep )
if sinep:IsPlayer() then
sinep:Kill()
end
end[/CODE]
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:
[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[/CODE]
If you can help educate me on how to make this work, then thank you VERY much!
Print the model of the touching entity to see if it is [b]exactly[/b] the same.
why is the position relative to the entity?
Sorry, you need to Log In to post a reply to this thread.