Robot upside down and operating side of the tool

Hello dear community. I have a question regarding the settings of my robot. I have created the task from a curve, but the robot does all the wild tricks you can image by moving upside down in order to perform. How can I lock some of the joints of have him operate "from the top" withouth having to go into every single tag manually? Also, I have added a customized tool, but did something wrong with the assignment of the connection point of the tool and now the nozzle "operates" at the connection point between robot and tool other the the tip of the nozzle. Can you please help me out here? :) Greetings to all of you.