Run it
Copy the script and paste it into your executor.
player = .Players.LocalPlayer
userInput = :()
runService = :()
playerGui = player:()
screenGui = .()
screenGui.Name =
screenGui.ResetOnSpawn =
screenGui.Parent = playerGui
directions = {
W = .(, , -),
A = .(-, , ),
S = .(, , ),
D = .(, , )
}
keyToDirection = {
[.KeyCode.Up] = directions.W,
[.KeyCode.Left] = directions.A,
[.KeyCode.Down] = directions.S,
[.KeyCode.Right] = directions.D
}
(name, pos)
btn = .()
btn.Name = name
btn.Text = name
btn.Size = .(, , , )
btn.Position = pos
btn.BackgroundColor3 = .(, , )
btn.TextColor3 = .(, , )
btn.TextScaled =
btn.Font = .Font.SourceSansBold
btn.Parent = screenGui
btn
buttons = {
W = (, .(, -, , -)),
A = (, .(, -, , )),
S = (, .(, -, , )),
D = (, .(, , , ))
}
(character, enable)
humanoid = character:()
humanoid
isR6 = humanoid.RigType == .HumanoidRigType.R6
humanoid.PlatformStand = enable
humanoid.AutoRotate = enable
humanoid.Sit =
(motor)
a1 = .(, motor.Part0)
a2 = .(, motor.Part1)
a1.CFrame = motor.C0
a2.CFrame = motor.C1
socket = .()
socket.Attachment0 = a1
socket.Attachment1 = a2
socket.Parent = motor.Parent
motor.Enabled =
motor.Name =
(motor)
motor.Enabled =
motor.Name =
_, item (motor.Parent:())
item:() item:()
item:()
_, joint character:()
joint:() (isR6 joint.Name ~= isR6)
enable joint.Name ~=
(joint)
enable joint.Name ==
(joint)
(hrp)
runService.Heartbeat:()
ray = Ray.(hrp.Position, .(, -, ))
hit = :(ray, hrp.Parent)
hit
(directionVec)
char = player.Character player.CharacterAdded:()
hrp = char:()
humanoid = char:()
hrp humanoid
force = hrp.CFrame:(directionVec.Unit * + .(, , ))
(char, )
hrp.AssemblyLinearVelocity = .zero
hrp:(force * hrp.AssemblyMass)
.(()
(hrp)
.()
(char, )
)
key, btn (buttons)
btn.MouseButton1Click:(()
(directions[key])
)
userInput.InputBegan:((input, processed)
processed
dir = keyToDirection[input.KeyCode]
dir
(dir)
)
pretty self explanatory title, i use It as a knockback simulation but you can use It as whatever i guess

Universal