[X] My suggestion intends to add or improve something
Version
Main (Production)
Topic
A programming feature (e.g. APIs, tweaks, changes, etc)
Why are you making your suggestion?
Currently, Seats (and afaik VehicleSeats) have no methods to query the currently-sitting player or get notified when a player sits/leaves. This proposal is meant to fill that gap and allow builds that respond to players sitting in Seats, which would be especially helpful for e.g. Seat+Keyboard-controlled vehicles.
What do you propose? What should change, or what should be added?
I propose the following APIs to be added to Seat (and VehicleSeat):
Method: getPlayer(): number? - Returns the ID of the currently-sitting player, or nil if there is no sitting player.
Method: eject() - Forces the currently-sitting player to leave the seat.
Event: PlayerChanged(player: number, sitting: boolean) - Fires whenever a player sits in or leaves the Seat.
Guidelines
Version
Main (Production)
Topic
A programming feature (e.g. APIs, tweaks, changes, etc)
Why are you making your suggestion?
Currently, Seats (and afaik VehicleSeats) have no methods to query the currently-sitting player or get notified when a player sits/leaves. This proposal is meant to fill that gap and allow builds that respond to players sitting in Seats, which would be especially helpful for e.g. Seat+Keyboard-controlled vehicles.
What do you propose? What should change, or what should be added?
I propose the following APIs to be added to Seat (and VehicleSeat):
getPlayer(): number?
- Returns the ID of the currently-sitting player, ornil
if there is no sitting player.eject()
- Forces the currently-sitting player to leave the seat.PlayerChanged(player: number, sitting: boolean)
- Fires whenever a player sits in or leaves the Seat.