EDIT: The problem has been resolved!: Check the other answer/ comment written by myself, below.
Hey there. I was trying to get a certain seat part whenever a humanoid/ player would sit on it. So I check out the wiki: https://developer.roblox.com/en-us/api-reference/event/Humanoid/Seated
And found the "Humanoid.SeatPart", that sounded like just what I needed. But before trying out the "Humanoid.SeatPart" property, I first wanted to test the "Humanoid.Sit" property.
So I made a Local Script in the StarterPack, and a Seat object in Workspace.
This is the code that I used:
if game.Players.LocalPlayer.Character.Humanoid.Sit==true then
print "Character is sitting"
else
print "Character is not sitting"
end
The code is super simple, and I have no clue why it doesn't work...
The Output says:
" Players.henrikknudsen.Backpack.LocalScript:1: attempt to index field 'Character' (a nil value)"
Thanks in advance! :-)

6 comments
I entered the part of your error after the colon and found the solution to your problem. https://scriptinghelpers.org/questions/11042/attempt-to-index-field-field-character-a-nil-value
Please don't ask a question if the answer can be found with a google search.
Especially when it's the first thing that pops up...
Trust me, I wouldn't post some mindless question before doing some research on beforehand. Actually, I hadn't seen the link that you just sent (but I have been checking a lot of other places). But the answers in that thread doesn't help me fix my problem. I corrected my script a bit my applying the "local player = game:GetService'Players'.LocalPlayer" and
So, if you or anyone else could help me fix it, I would really appreciate it!