Run it
Copy the script and paste it into your executor.
Players = :()
UserInputService = :()
TweenService = :()
Player = Players.LocalPlayer
MIN_SPEED =
MAX_SPEED =
DEFAULT_SPEED =
STEP_DISTANCE =
Speed = DEFAULT_SPEED
Running =
Keys = {
[.KeyCode.W] = ,
[.KeyCode.A] = ,
[.KeyCode.S] = ,
[.KeyCode.D] = ,
}
()
Character = Player.Character
Character
Character:()
()
Camera = .CurrentCamera
Camera
.zero
Look = Camera.CFrame.LookVector
Right = Camera.CFrame.RightVector
Forward = .(
Look.X,
,
Look.Z
)
CameraRight = .(
Right.X,
,
Right.Z
)
Forward.Magnitude >
Forward = Forward.Unit
CameraRight.Magnitude >
CameraRight = CameraRight.Unit
Direction = .zero
Keys[.KeyCode.W]
Direction += Forward
Keys[.KeyCode.S]
Direction -= Forward
Keys[.KeyCode.D]
Direction += CameraRight
Keys[.KeyCode.A]
Direction -= CameraRight
Direction.Magnitude ==
.zero
Direction.Unit
()
Running
Running =
Keys[.KeyCode.W]
Keys[.KeyCode.A]
Keys[.KeyCode.S]
Keys[.KeyCode.D]
Root = ()
Root
.()
Direction = ()
Direction.Magnitude >
TargetPosition =
Root.Position + Direction * STEP_DISTANCE
TargetCFrame =
.(TargetPosition) *
Root.CFrame.Rotation
Duration =
STEP_DISTANCE / .(Speed, )
Tween = TweenService:(
Root,
TweenInfo.(
Duration,
.EasingStyle.Linear,
.EasingDirection.Out
),
{
= TargetCFrame
}
)
Tween:()
Tween.Completed:()
.()
Running =
UserInputService.InputBegan:((Input, Processed)
Processed
Keys[Input.KeyCode] ~=
Keys[Input.KeyCode] =
.(MovementLoop)
)
UserInputService.InputEnded:((Input)
Keys[Input.KeyCode] ~=
Keys[Input.KeyCode] =
)
GUI = .()
GUI.Name =
GUI.ResetOnSpawn =
GUI.Parent = Player:()
Frame = .()
Frame.Name =
Frame.Size = .(, )
Frame.Position = .(, -, , -)
Frame.BackgroundColor3 = .(, , )
Frame.BorderSizePixel =
Frame.Active =
Frame.Parent = GUI
Corner = .()
Corner.CornerRadius = .(, )
Corner.Parent = Frame
Title = .()
Title.Size = .(, -, , )
Title.Position = .(, )
Title.BackgroundTransparency =
Title.Text =
Title.TextColor3 = .(, , )
Title.TextSize =
Title.Font = .Font.GothamBold
Title.Parent = Frame
Dragging =
DragStart
StartPosition
Title.InputBegan:((Input)
Input.UserInputType == .UserInputType.MouseButton1
Dragging =
DragStart = Input.Position
StartPosition = Frame.Position
)
UserInputService.InputChanged:((Input)
Dragging
Input.UserInputType == .UserInputType.MouseMovement
Delta = Input.Position - DragStart
Frame.Position = .(
StartPosition.X.Scale,
StartPosition.X.Offset + Delta.X,
StartPosition.Y.Scale,
StartPosition.Y.Offset + Delta.Y
)
)
UserInputService.InputEnded:((Input)
Input.UserInputType == .UserInputType.MouseButton1
Dragging =
)
SpeedLabel = .()
SpeedLabel.Size = .(, -, , )
SpeedLabel.Position = .(, )
SpeedLabel.BackgroundTransparency =
SpeedLabel.Text = .. Speed
SpeedLabel.TextColor3 = .(, , )
SpeedLabel.TextSize =
SpeedLabel.Font = .Font.Gotham
SpeedLabel.TextXAlignment = .TextXAlignment.Left
SpeedLabel.Parent = Frame
Slider = .()
Slider.Name =
Slider.Size = .(, -, , )
Slider.Position = .(, )
Slider.BackgroundColor3 = .(, , )
Slider.BorderSizePixel =
Slider.Active =
Slider.Parent = Frame
SliderCorner = .()
SliderCorner.CornerRadius = .(, )
SliderCorner.Parent = Slider
Fill = .()
Fill.Size = .(
(Speed - MIN_SPEED) / (MAX_SPEED - MIN_SPEED),
)
Fill.BackgroundColor3 = .(, , )
Fill.BorderSizePixel =
Fill.Parent = Slider
FillCorner = .()
FillCorner.CornerRadius = .(, )
FillCorner.Parent = Fill
Knob = .()
Knob.Size = .(, )
Knob.AnchorPoint = .(, )
Knob.Position = .(
(Speed - MIN_SPEED) / (MAX_SPEED - MIN_SPEED),
,
,
)
Knob.BackgroundColor3 = .(, , )
Knob.BorderSizePixel =
Knob.Text =
Knob.AutoButtonColor =
Knob.Parent = Slider
KnobCorner = .()
KnobCorner.CornerRadius = .(, )
KnobCorner.Parent = Knob
SliderDragging =
(X)
Percent = .(
(X - Slider.AbsolutePosition.X)
/ Slider.AbsoluteSize.X,
,
)
Speed = .(
MIN_SPEED
+ ((MAX_SPEED - MIN_SPEED) * Percent)
+
)
Normalized =
(Speed - MIN_SPEED)
/ (MAX_SPEED - MIN_SPEED)
Fill.Size = .(
Normalized,
)
Knob.Position = .(
Normalized,
,
,
)
SpeedLabel.Text = .. Speed
Slider.InputBegan:((Input)
Input.UserInputType == .UserInputType.MouseButton1
SliderDragging =
(Input.Position.X)
)
Knob.InputBegan:((Input)
Input.UserInputType == .UserInputType.MouseButton1
SliderDragging =
)
UserInputService.InputChanged:((Input)
SliderDragging
Input.UserInputType == .UserInputType.MouseMovement
(Input.Position.X)
)
UserInputService.InputEnded:((Input)
Input.UserInputType == .UserInputType.MouseButton1
SliderDragging =
)
Player.CharacterAdded:(()
Key (Keys)
Keys[Key] =
Running =
)
Universal