I was trying to get something to happen when a player sits in a seat this is what i have,
game.Workspace.Table.Red.Touched:connect(function(touched) if touched.Parent.Humanoid.Seated == true then print("Red Get off Bruh") else wait() return end end)
it does not seem to do anything
game.Workspace.Table.Red.Touched:connect(function(touched) if touched.Parent.Humanoid.Sit == true then -- the only problem I see is with seated == sit. print("Red Get off Bruh") else wait() return end end)
Touching is not exactly Seating, so I recommend to use DescendantAdded. I'll explain:
When your character seats, a Weld is created between his torso and the seat, and it's called "SeatWeld", so all you gotta do to detect it is check when a descendant of the seat called SeatWeld is added. It is more practical than checking the Humanoid.
game.Workspace.Table.Red.DescendantAdded:connect(function(descendant) if descendant.Name == "SeatWeld" then print("Red Get off Bruh") else wait() return end end)