So I've been looking for an answer to this for a few hours and i haven't been able to find ANYTHING. I want the player to drown after being under water for (x) amount of seconds. But i don't know how to even get started, or where to put the script.
Here's what you can do:
Use a https://developer.roblox.com/en-us/api-reference/event/Humanoid/StateChanged to detect when the player is Swimming.
When they are detected to be swimming, you can start counting down on a timer. When the humanoid's state is changed to something other then swimming, cancel the timer. If the timer reaches 0, you can kill the player.