First of all I am not a good scripter so if this an easy question dont bully me. Anyway here is the script
local uis = game:GetService("UserInputService")
local cooldown = true
uis.InputBegan:connect(function(input,gameproccesed)
if input.KeyCode==Enum.KeyCode.E then
if cooldown == true then
local tp = Instance.new("Part")
tp.CanCollide = true
tp.Parent = game.Workspace
tp.CFrame = game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.lookVector*10 -- This line has the problem
wait(1)
game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame = tp.CFrame
end
end
end)
I am trying to make an sort of dash thing. An object spawns ahead of the player and then a moment later the player teleports there.
If you catch any other errors in the code please tell me :) I need that help
