The code sample for https://developer.roblox.com/en-us/api-reference/event/Humanoid/Seated won’t function correctly if used how the page instructs.
Following the documentation, pasting the code example in StarterPlayerScripts should work, however line 1 attempts to reference the character using script.Parent
which is the player, not the character.
For it to be correct, the documentation should say StarterCharacterScripts instead.