Hello, I have gotten this script from MetaDevv, I wanna know how I would make it so I can change how far the tween takes them, and make the tween move them behind instead of in front of the player.
local TweenService = game:GetService("TweenService")
--// Variables
local torso = script.Parent
local intersection
local TIME = 5 -- time it takes for player2 to reach wall
--// Functions
local raycastParams = RaycastParams.new()
raycastParams.FilterDescendantsInstances = {} -- PUT CHARACTER BASEPARTS IN HERE!!
raycastParams.FilterType = Enum.RaycastFilterType.Blacklist
local raycastResult = workspace:Raycast(torso.Position, torso.CFrame.LookVector * 1000, raycastParams)
if raycastResult then -- if part detected
intersection = raycastResult.Position
else
intersection = torso.CFrame.LookVector * 1000
end
local speed = (torso.Position - intersection).Magnitude / TIME -- speed = dist / time
local tween = TweenService:Create(torso, TweenInfo.new(speed), {CFrame = CFrame.new(intersection)}) -- add everything together
tween:Play()