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

Teleport the player lets say 5 studs away from the origina position?

Asked by 4 years ago

allready have the local script that fires server event in replicated storage

heres the script i have rn

local rp = game:GetService("ReplicatedStorage")
local Teleport = rp.Stand1Remotes:WaitForChild("Teleport")
local Player = game:GetService'Players'.LocalPlayer

local TimeSkip = game.Workspace.SFX.TW.TimeSkip

Teleport.OnServerEvent:Connect(function(Player)
    TimeSkip:Play()

    wait(1)


    TimeSkip:Stop()

    wait(3)
   Teleport:FireClient(Player)

end)

1 answer

Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago

use CFrame.LookVector to move them forwards relative to their position:

local CF = Character.CFrame;
Character.CFrame = CF + (CF.LookVector * distance)
Ad

Answer this question