Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How Do I Detect If A Player Is In A Seat?

Asked by 4 years ago

I am making a plane, I know there may be better ways, but I want to learn my own way and expand my creativity. What I'm trying to do is make the plane anchor when nobody is driving it, but when someone sits in the driver's seat it will unanchor allowing movement. I am very new to scripting, the most I can do is color changing and basic part movement!

1 answer

Log in to vote
3
Answered by 4 years ago
Edited 4 years ago

So you will need to do is detect the seat if it is seated using occupant put this script inside the plane seat

script.Parent.Changed:Connect(function() -- Detect the seat property changed
       if seat.Occupant  ~= nil then -- the seat is seated
              script.Parent.Anchored = true
       else
              script.Parent.Anchored = false 
       end
end)
0
Thanks so much! Rhynokeros 0 — 4y
1
You welcome :D Nguyenlegiahung 1091 — 4y
Ad

Answer this question