Squatting is not an option in Scotland. If you are caught trying to get into someone else's property or living there without permission, you could end up facing criminal and civil action.
The owner or lawful occupier of the property you're squatting in has the right to eject you from the premises without giving you any notice or applying to the court for an eviction order. However, in evicting you, they cannot do anything that would break the law, for example use violence against you. You can also face a fine and even imprisonment if you are caught squatting.