local BlinkersEvent = script.Parent.Blinkers
local LeftTurnSignal = script.Parent.LTS
local RightTurnSignal = script.Parent.RTS
local UserInputService = game:GetService("UserInputService")
local DriverSeat = script.Parent.Parent.Parent.DriveSeat
local function LTS()
LeftTurnSignal.Transparency = 0
wait(1)
LeftTurnSignal.Transparency = 1
end
local function RTS()
RightTurnSignal.Transparency = 0
wait(1)
RightTurnSignal.Transparency = 1
end
local function Hazards()
LeftTurnSignal.Transparency = 0
RightTurnSignal.Transparency = 0
wait(1)
LeftTurnSignal.Transparency = 1
RightTurnSignal.Transparency = 1
end
UserInputService.InputBegan:Connect(function(input, gameProcessedEvent)
print("Input began:", input.KeyCode)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.Q then
LTS()
elseif input.KeyCode == Enum.KeyCode.E then
RTS()
elseif input.KeyCode == Enum.KeyCode.X then
Hazards()
end
end
end)
Hey Connor,
as @LuaCoold already said, you cannot run the local script in workspace or any instance in the workspace. Additionally, UserInputService does not work in a server script.
In order to make your script work, you can do the following:
Create a remote event and place it into the replicated storage and give it a name such as „ControlCarRemote“
Replace the local script in the folder with a server script
Add a local script in „StarterCharacterScripts“
Remove the „UserInputService“ part of the server script and add it into the local script.
Instead of calling a function in the local script, you will send a value to the server with the remote event.
For instance: controlCarRemote:FireServer(„LTS“) — if you press Q
Receive the value with the server script and call the correct function based on the sent value