Simple as the title, the If-Statement is not proceeding when all the expressions are true. I'm trying to see if the player is sitting and the parent of the seat that the player is sitting in is called "Bed". Not sure why it is not firing.
More info: Already made sure that the model of the seat is actually "Bed" (using print), and the if statement does fire when the player is seated (Without the 2nd expression), it's just when I added the second expression, it's not firing.
More Details: The script is in a LocalScript in StarterGui, just tried using game.Players.LocalPlayer.Character with no luck. Also, this is just a snippet of the actual code, I do have an average knowledge of lua, so there aren't any basic errors (like missing an end). Updated script below.
if game.Players.LocalPlayer.Character.Humanoid.Sit == true and game.Players.LocalPlayer.Character.SeatPart.Parent.Name == "Bed" then
game.Workspace.Values.NumInBed.Value = workspace.Values.NumInBed.Value + 1
script.Parent.Parent.Character.Humanoid.JumpPower = 0

5 comments
Use this to get the character. \-- game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait() --// All of that to get the character.
Just tried before you commented, didn't work. I'll make a note.
You're also missing an end at the bottom to close off the function.
This is not the full code, just a snippet of it....
Oh ok