This is all complicated. A grey area.
I live in Thailand. It's not allowed to work at all, not for a LTD, not for a LLP. You can get a visa if you find a local company wanting to hire you, or you can start a company in Thailand. But in all other cases work is not allowed.
Leaving the funds...