How would I make a platform that both swings and pivots on hinges?

KRKRUS4DEFeb 16 202106010
    Halo and Forge Discussion

https://files.catbox.moe/w8yc6c.jpeg

All I can get it to do is swing :( I want it to swing back and forth but also have a tilt effect when you get close to the front or back edge (with restrainer blocks a bit underneath it of course :P