Run it
Copy the script and paste it into your executor.
player = :().LocalPlayer
character = player.Character player.CharacterAdded:()
humanoid = character:()
rootPart = character:()
userInputService = :()
runService = :()
drivingSpeed =
turningSpeed =
acceleration =
deceleration =
friction =
isDriving =
originalWalkSpeed =
originalJumpPower =
carBase, bodyVelocity, bodyGyro, weld
currentSpeed =
targetRotation =
keysPressed = {
W = ,
A = ,
S = ,
D =
}
screenGui = .()
screenGui.Name =
screenGui.ResetOnSpawn =
screenGui.ZIndexBehavior = .ZIndexBehavior.Sibling
screenGui.Parent = player:()
creditsFrame = .()
creditsFrame.Size = .(, , , )
creditsFrame.Position = .(, -, , -)
creditsFrame.BackgroundColor3 = .(, , )
creditsFrame.BorderSizePixel =
creditsFrame.BorderColor3 = .(, , )
creditsFrame.ZIndex =
creditsFrame.Parent = screenGui
creditsCorner = .()
creditsCorner.CornerRadius = .(, )
creditsCorner.Parent = creditsFrame
creditsTitle = .()
creditsTitle.Size = .(, -, , )
creditsTitle.Position = .(, , , )
creditsTitle.BackgroundTransparency =
creditsTitle.Text =
creditsTitle.TextColor3 = .(, , )
creditsTitle.TextSize =
creditsTitle.Font = .Font.SourceSansBold
creditsTitle.TextXAlignment = .TextXAlignment.Left
creditsTitle.ZIndex =
creditsTitle.Parent = creditsFrame
creditsText = .()
creditsText.Size = .(, -, , )
creditsText.Position = .(, , , )
creditsText.BackgroundTransparency =
creditsText.Text =
creditsText.TextColor3 = .(, , )
creditsText.TextSize =
creditsText.Font = .Font.SourceSans
creditsText.TextXAlignment = .TextXAlignment.Left
creditsText.TextYAlignment = .TextYAlignment.Top
creditsText.ZIndex =
creditsText.Parent = creditsFrame
closeButton = .()
closeButton.Size = .(, , , )
closeButton.Position = .(, -, , )
closeButton.BackgroundColor3 = .(, , )
closeButton.BorderSizePixel =
closeButton.Text =
closeButton.TextColor3 = .(, , )
closeButton.TextSize =
closeButton.Font = .Font.SourceSansBold
closeButton.ZIndex =
closeButton.Parent = creditsFrame
closeCorner = .()
closeCorner.CornerRadius = .(, )
closeCorner.Parent = closeButton
closeButton.MouseButton1Click:(()
creditsFrame:(
.(, , , -),
.EasingDirection.In,
.EasingStyle.Back,
,
,
()
creditsFrame.Visible =
)
)
creditsFrame.Position = .(, , , -)
.()
creditsFrame:(
.(, -, , -),
.EasingDirection.Out,
.EasingStyle.Back,
,
)
toggleButton = .()
toggleButton.Size = .(, , , )
toggleButton.Position = .(, -, , )
toggleButton.BackgroundColor3 = .(, , )
toggleButton.BorderSizePixel =
toggleButton.BorderColor3 = .(, , )
toggleButton.Text =
toggleButton.TextColor3 = .(, , )
toggleButton.TextSize =
toggleButton.Font = .Font.SourceSansBold
toggleButton.Modal =
toggleButton.Active =
toggleButton.ZIndex =
toggleButton.Parent = screenGui
toggleCorner = .()
toggleCorner.CornerRadius = .(, )
toggleCorner.Parent = toggleButton
speedometerFrame = .()
speedometerFrame.Size = .(, , , )
speedometerFrame.Position = .(, -, , )
speedometerFrame.BackgroundColor3 = .(, , )
speedometerFrame.BackgroundTransparency =
speedometerFrame.BorderSizePixel =
speedometerFrame.BorderColor3 = .(, , )
speedometerFrame.Visible =
speedometerFrame.ZIndex =
speedometerFrame.Parent = screenGui
speedometerCorner = .()
speedometerCorner.CornerRadius = .(, )
speedometerCorner.Parent = speedometerFrame
speedLabel = .()
speedLabel.Size = .(, , , )
speedLabel.Position = .(, , , )
speedLabel.BackgroundTransparency =
speedLabel.Text =
speedLabel.TextColor3 = .(, , )
speedLabel.TextSize =
speedLabel.Font = .Font.SourceSansBold
speedLabel.ZIndex =
speedLabel.Parent = speedometerFrame
unitLabel = .()
unitLabel.Size = .(, , , )
unitLabel.Position = .(, , , )
unitLabel.BackgroundTransparency =
unitLabel.Text =
unitLabel.TextColor3 = .(, , )
unitLabel.TextSize =
unitLabel.Font = .Font.SourceSans
unitLabel.ZIndex =
unitLabel.Parent = speedometerFrame
controlsFrame = .()
controlsFrame.Size = .(, , , )
controlsFrame.Position = .(, , , -)
controlsFrame.BackgroundTransparency =
controlsFrame.Visible =
controlsFrame.ZIndex =
controlsFrame.Parent = screenGui
(text, position, size)
button = .()
button.Size = size .(, , , )
button.Position = position
button.BackgroundColor3 = .(, , )
button.BackgroundTransparency =
button.BorderSizePixel =
button.BorderColor3 = .(, , )
button.Text = text
button.TextColor3 = .(, , )
button.TextSize =
button.Font = .Font.SourceSansBold
button.Modal =
button.Active =
button.ZIndex =
button.Parent = controlsFrame
corner = .()
corner.CornerRadius = .(, )
corner.Parent = button
button
upButton = (, .(, , , ))
leftButton = (, .(, , , ))
downButton = (, .(, , , ))
rightButton = (, .(, , , ))
(button, key)
isPressed =
button.MouseButton1Down:(()
isPressed =
keysPressed[key] =
button.BackgroundColor3 = .(, , )
)
button.MouseButton1Up:(()
isPressed =
keysPressed[key] =
button.BackgroundColor3 = .(, , )
)
button.InputBegan:((input)
input.UserInputType == .UserInputType.Touch
isPressed =
keysPressed[key] =
button.BackgroundColor3 = .(, , )
)
button.InputEnded:((input)
input.UserInputType == .UserInputType.Touch
isPressed =
keysPressed[key] =
button.BackgroundColor3 = .(, , )
)
button.MouseLeave:(()
isPressed
isPressed =
keysPressed[key] =
button.BackgroundColor3 = .(, , )
)
(upButton, )
(leftButton, )
(downButton, )
(rightButton, )
()
carBase
(() carBase:() )
carBase = .()
carBase.Name =
carBase.Size = .(, , )
carBase.Transparency =
carBase.CanCollide =
carBase.Anchored =
carBase.CFrame = rootPart.CFrame
carBase.Parent =
bodyVelocity = .()
bodyVelocity.MaxForce = .(, , )
bodyVelocity.Velocity = .(, , )
bodyVelocity.Parent = carBase
bodyGyro = .()
bodyGyro.MaxTorque = .(, , )
bodyGyro.P =
bodyGyro.Parent = carBase
weld = .()
weld.Part0 = carBase
weld.Part1 = rootPart
weld.C0 = .(, , )
weld.Parent = carBase
yRotation = (, rootPart.CFrame:())
targetRotation = yRotation
()
isDriving = isDriving
isDriving
()
.()
humanoid.WalkSpeed =
humanoid.JumpPower =
humanoid.Sit =
toggleButton.Text =
toggleButton.BackgroundColor3 = .(, , )
controlsFrame.Visible =
speedometerFrame.Visible =
carBase
(() carBase:() )
carBase =
.()
humanoid.Sit =
humanoid.WalkSpeed = originalWalkSpeed
humanoid.JumpPower = originalJumpPower
currentSpeed =
toggleButton.Text =
toggleButton.BackgroundColor3 = .(, , )
controlsFrame.Visible =
speedometerFrame.Visible =
key, _ (keysPressed)
keysPressed[key] =
upButton.BackgroundColor3 = .(, , )
leftButton.BackgroundColor3 = .(, , )
downButton.BackgroundColor3 = .(, , )
rightButton.BackgroundColor3 = .(, , )
toggleButton.Activated:(()
()
)
userInputService.InputBegan:((input, gameProcessed)
gameProcessed
input.KeyCode == .KeyCode.E
()
input.KeyCode == .KeyCode.W keysPressed.W =
input.KeyCode == .KeyCode.A keysPressed.A =
input.KeyCode == .KeyCode.S keysPressed.S =
input.KeyCode == .KeyCode.D keysPressed.D =
)
userInputService.InputEnded:((input)
input.KeyCode == .KeyCode.W keysPressed.W =
input.KeyCode == .KeyCode.A keysPressed.A =
input.KeyCode == .KeyCode.S keysPressed.S =
input.KeyCode == .KeyCode.D keysPressed.D =
)
lastPosition =
lastTime = ()
connection = runService.Heartbeat:((deltaTime)
isDriving carBase bodyVelocity bodyGyro
keysPressed.W
currentSpeed = .(currentSpeed + acceleration, drivingSpeed)
keysPressed.S
currentSpeed = .(currentSpeed - deceleration, -drivingSpeed * )
currentSpeed >
currentSpeed = .(currentSpeed - friction, )
currentSpeed <
currentSpeed = .(currentSpeed + friction, )
keysPressed.A
targetRotation = targetRotation + turningSpeed * deltaTime
keysPressed.D
targetRotation = targetRotation - turningSpeed * deltaTime
bodyGyro.CFrame = .(, targetRotation, )
direction = bodyGyro.CFrame.LookVector
bodyVelocity.Velocity = direction * currentSpeed
currentTime = ()
currentPosition = carBase.Position
lastPosition
distanceTraveled = (currentPosition - lastPosition).Magnitude
timeDelta = currentTime - lastTime
timeDelta >
studsPerSecond = distanceTraveled / timeDelta
displaySpeed = .(studsPerSecond)
displaySpeed = .(displaySpeed, , )
speedLabel.Text = .(, displaySpeed)
displaySpeed <
speedLabel.TextColor3 = .(, , )
displaySpeed <
speedLabel.TextColor3 = .(, , )
speedLabel.TextColor3 = .(, , )
lastPosition = currentPosition
lastTime = currentTime
carBase carBase.Parent
carBase.CFrame = .(carBase.Position.X, carBase.Position.Y, carBase.Position.Z) * .(, targetRotation, )
)
player.CharacterAdded:((newChar)
character = newChar
humanoid = character:()
rootPart = character:()
isDriving =
currentSpeed =
carBase
(() carBase:() )
carBase =
toggleButton.Text =
toggleButton.BackgroundColor3 = .(, , )
controlsFrame.Visible =
speedometerFrame.Visible =
)
Universal