two condition darkrp

I am trying to attach an entity to a door so it moves with it, how can I do this?

[editline]30th September 2017[/editline]

figured it out by accident