Hello, everyone. Im trying to make a plane, but for some reason when I sit on the driver seat and press e, it doesnt start going forward.
Script:
local seat = script.Parent
local main = script.Parent.Parent.Main
local useri = game:GetService("UserInputService")
local going
velocity = 400
seat:GetPropertyChangedSignal("Occupant"):Connect(function()
print("PlayerSeated")
useri.InputBegan:Connect(function(imput)
if imput.KeyCode == Enum.KeyCode.E and seat.Occupant ~= nil then
print("Turned on")
going = true
main.Velocity = main.CFrame.LookVector * velocity
while wait(0.1) and going == true do
print("Going")
main.Velocity = main.CFrame.LookVector * velocity
end
end
end)
end)