Problems when making a plane move

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)


1 Like

Are there any errors? Do any of the print functions run? If yes, which? We can’t really help without enough information.

No errors, none of the prints work.

1 Like

Are you sure the code is running? I tested part of the code and “PlayerSeated” was printed in the output. Maybe you disabled the localscript?

1 Like

Its a serverscript. 30characters

1 Like

You can’t use UserInputService on the server. Even though, it should’ve printed “PlayerSeated” before giving you an error.

1 Like