Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to move a vehicle a stud further on press of a key?

Asked by 2 years ago

Hello! I'm new to making vehicles and im trying to make a vehicle move a couple studs further on press of a key. but i dont know how to make a vehicle move. I tried this code Code: Local Script in starterCharacterScripts

local UIS = game:GetService("UserInputService")
local player = game.Players.LocalPlayer
local humanoid = player.Character:FindFirstChild("Humanoid")
local character = script.Parent
local humanoid = character:WaitForChild("Humanoid")






UIS.InputBegan:Connect(function(input, gameProccessedEvent)
    humanoid.Seated:Connect(function(isSeated, seat)
        if isSeated then
            if input.KeyCode == Enum.KeyCode.W then
                wait(3)
                local model = game.Workspace.Bike
                model:MoveTo(Vector3.new(1, 0, 0))

            end
        end

    end)

end)

But this didnt really work. Does anyone know how to do this?

Answer this question