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

How can I make a Police GUI for my own Lightbar?

Asked by 5 years ago
Edited 5 years ago

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!

0
GUI* instead of guy in the title, sorry about that. Gabrix23 6 — 5y
0
you can edit the question as much as you like. Please follow https://scriptinghelpers.org/help/how-post-good-questions-answers User#5423 17 — 5y

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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

0
Thank you! Gabrix23 6 — 5y
Ad

Answer this question