Whenever I run the game, it says "Attempt to connect failed: Passed value is not a function" (The script is inside the vehicleseat)
script.Parent.ChildAdded:connect(function(newChild)
if newChild:IsA("Weld") then
if newChild.Part1.Name == "HumanoidRootPart" then
local player = game.Players:GetPlayerFromCharacter(newChild.Part1.Parent)
if (player) then
function KeyPress(input, gameProcessed)
if input.KeyCode == Enum.KeyCode.W then
print("OMG W WAS PRESS ! !! ! !")
end
end
end
end
end
end)
game:GetService("UserInputService").InputBegan:Connect(KeyPress)
