I'm creating a police car for my own, I created the light and I scripted them flashing but I don't know how to make a GUI that appears when a humanoid sits on the driver sit, that can control lights and siren. Please Help!
COMMUNITY QUESTION
How can I make a Police GUI for my own Lightbar?
1 answer
You can do this using Seat.Occupant (or VehicleSeat.Occupant)
local Seat = script.Parent.DriverSeat
Seat:GetPropertyChangedSignal("Occupant"):Connect(function()
local Driver = game:GetService("Players"):GetPlayerFromCharacter(Seat.Occupant.Parent)
--The Driver is the player in the Seat
--Put here the code you want :)
end)
Seat.Occupant returns the Driver's Humanoid
1 comment
0
Thank you!
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
GUI* instead of guy in the title, sorry about that.
you can edit the question as much as you like. Please follow https://scriptinghelpers.org/help/how-post-good-questions-answers