I am trying to make it so when a player sits in an vehicle seat it and presses K it fires the event
I have tried to use chatgpt but it didn’t help.
If somebody sees an flaw please say!
I also don’t see any error in the console or output.
I created an backup script that prints something when it is pressed it printed out an line but it doesn’t print anything.
local seat = script.Parent.VehicleSeat
local UIP = game:GetService("UserInputService")
local gKeyEvent = script.Parent:WaitForChild("SmokeEvent")
local function onInputBegan(input, gameProcessedEvent)
if not gameProcessedEvent then
if input.KeyCode == Enum.KeyCode.K then
local occupant = seat.Occupant
if occupant and occupant:IsA("Player") then
gKeyEvent:FireServer()
end
end
end
end
UIP.InputBegan:Connect(onInputBegan)