The purpose of the script is to teleport the Player in the direction they're walking (W,A,S,D) by 20 studs (or however many studs)
local UIS = game:GetService("UserInputService")
local Players = game:GetService("Players")
local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")
local HUMRP = Character:FindFirstChild("HumanoidRootPart")
local Children = Character:GetDescendants()
local Properties = {
Velocity = 20,
Duration = 1,
Keybind = Enum.KeyCode.Q,
Cooldown = 2
}
UIS.InputBegan:Connect(function(input,gameprocessed)
if input.KeyCode == Properties.Keybind then
print(Humanoid.MoveDirection)
for i,v in pairs(Children) do
if v:IsA("Part") then
v.Position = HUMRP.Position
end
end
HUMRP.Position = HUMRP.Position * Vector3.new(2,0,0)
end
end)
I tried this and tried switching some things around but to no surprise it didnt work as intended. All it does right now is teleport you but glitches your camera and make you stuck in the ground. How would I fix this?
