[SOLVED] Disabling player movement when UI is open

THE PROBLEM WAS IN EXECUTION ORDER OF THE SCRIPTS!!!
FOR ANYONE WITH THE SAME PROBLEM, LEAVE A COMMENT AND I WILL HELP YOU! <3

“Im trying to make player movement disabled when in UI”

When i open UI panel (“menu”), the player does not move[movement is canceled],
but the problem is when im already in movement and i open UI, the player gets “stucked” moving in that position until i exit the UI.

I cannot figure out why

Very sorry for posting the whole script, I just dont know where the probem might be.