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 6 years ago
Edited 6 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 — 6y
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 — 6y

1 answer

Log in to vote
1
Answered by 6 years ago
Edited 6 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 — 6y
Ad

Answer this question