How to do: "If" statement is triggered when the player sits on a DriveSeat

Hi, so I want that when a player sits on the DriveSeat (on the driver’s seat of a train), the red front lights change color to black and the white ones change color to white. I know how to change the color of a part, but I couldn’t find anywhere how to check if the player is sitting, and if the player is sitting, then trigger the “if” statement.

warn("Setting up lights")
local RedLeft = script.Parent.Parent.LightsFront.LightsModel.RedLeft
local RedRight = script.Parent.Parent.LightsFront.LightsModel.RedRight
local WhiteLeft = script.Parent.Parent.LightsFront.LightsModel.WhiteLeft
local WhiteRight = script.Parent.Parent.LightsFront.LightsModel.WhiteRight
local character = 
local humanoid = character:WaitForChild("Humanoid")

wait(5)
RedLeft.BrickColor = BrickColor.new("Black")
RedRight.BrickColor = BrickColor.new("Black")
WhiteLeft.BrickColor = BrickColor.new("Daisy orange")
WhiteRight.BrickColor = BrickColor.new("Daisy orange")
wait(2)
RedLeft.BrickColor = BrickColor.new("Bright red")
RedRight.BrickColor = BrickColor.new("Bright red")
WhiteLeft.BrickColor = BrickColor.new("Black")
WhiteRight.BrickColor = BrickColor.new("Black")

-- The if statement here

Info: I am NOT asking for the code but for help ^^

Thank you in advance.

Humanoid.Sit

You can use Humanoid.SeatPart to get what SeatPart is the player sitting on. And also you need to check if it’s DriveSeat or not.

Ok, thank you so much for the help!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.