Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Make someone teleport specific # of studs forward? (no script made)

Asked by 5 years ago

I have experimented for a while, but I can figure out how to check which direction the player is facing, and then to teleport them 15 studs in that direction, anyone know how?

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

Please provide explanation with your answers. Simply posting code does not spread knowledge of integral scripting processes which helps people understand the logic and reasoning behind your answer.

place in localScript in starterPack:

local root = game.Players.LocalPlayer.CharacterAdded:Wait():WaitForChild("HumanoidRootPart")

game:GetService("UserInputService").InputBegan:Connect(function(input, process)
    if process then return end

    if input.UserInputType == Enum.UserInputType.MouseButton1 then
        root.CFrame = root.CFrame * CFrame.new(0, 0, -15)
    end
end)

i presume i reserve the right to not explain the stuff to u; u can find it out urself its simple enough im trying my luck that as to whether the answer will get accepted anyway

0
ty this helped a ton :)) Gomenasa1 32 — 5y
0
how to not get your answer accepted 101 User#24403 69 — 5y
Ad

Answer this question