just set a bool ‘bisflying’ true on pressed and false on released. RPC this to the server and repnotify it back if you want client side prediction.
run all the logic on server. you probably dont want impulse thats used for one time bursts. try add force instead. also you may need to set the movement mode to flying