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

How can i make a seat event that fires when someone seats on a block?

Asked by 5 years ago

How can i make a event that fires when a player seats on a determined block?

1 answer

Log in to vote
1
Answered by
hellmatic 1523 Moderation Voter
5 years ago
Edited 5 years ago

You can use GetPropertyChangedSignal:

``` local Seat = script.Parent

-- GetPropertyChangedSignal fires when the given property (in this case "Occupant") changes Seat:GetPropertyChangedSignal("Occupant"):Connect(function() local Occupant = Seat.Occupant -- Seats have a property called occupant. When a npc/player is seated, the occupant is set to their humanoid local Player = ( Occupant and game.Players:GetPlayerFromCharacter(Occupant.Parent) ) if Player then print(Player) end end) ```

0
Thanks m8 User#27525 1 — 5y
Ad

Answer this question