A Issue I have with this

My issue is that I want to make it so where they hold E down they are able to sit in the seat.
But my problem is It wont sit me down in the seat.
The error code: [10:26:01.833 - Seat is not a valid member of Seat “Workspace.Seat”]
Here is the script
local proximityPrompt = script.Parent
local seat = proximityPrompt.Parent.Seat
seat:GetPropertyChangedSignal(“Occupant”):Connect(function()
if seat.Occupant then
proximityPrompt.Enabled = false
else
proximityPrompt.Enabled = true
end
end)
proximityPrompt.Triggered:Connect(function(player)
seat:Sit(player.Character.Humanoid)
end)

Just add a :WaitForChild() here to wait for seat to load:
local seat = proximityPrompt.Parent:WaitForChild("Seat")

Is the seat actually the parent of proximityPrompt and not inside of the parent?

It is in the seat And everything works except that one error

What line does it say the error is on? And can use a code block instead of just pasting your script in?

If it is in the seat then just remove the word “Seat” after parent. I’m not entirely sure if this will remove the error

The error is on this line
local seat = proximityPrompt.Parent.Seat

Yeah, try taking Parent out and see if it works. If it doesn’t let me know what the error is. If there is one, if it doesn’t give you an error let me know what it does.

1 Like

I took the .seat out of the script so its just parent and it works