Im trying to make an under water game

(i haven’t used roblox dev forum in a while so idk if I’m setting this out right)
I’m trying to make a swimming script were you only go up by pressing space if you don’t press it you keep going down I have a example of the script which is used on another game

I don’t know where to start since I don’t script often

UserInputService to bind an action to the spacebar, where you modify a part’s density which would then affect the buoyant force acting on the character.

Just enable CustomPhysicalProperties on the character’s HumanoidRootPart and then set the rootpart’s Density to like 2