I have found a solution for the first one however it isn't very efficient.I made a variable grounded and whenever a block collides with ground it triggers grounded.Grounded variable just sets the blocks physics to immovable.Not a perfect way of doing it really.