I can’t find a good way to make the tween work for this, so instead just change the CFrame, probably not the best way to do it but it’s a temporary fix
local runService = game:GetService(“RunService”)
game.Players.PlayerAdded:Connect(function(player)
task.wait(5)
local character = player.Character or player.CharacterAdded:Wait()
local part = script.Parent
local tweenService = game:GetService("TweenService")
local tweenToPositon = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
local tween = tweenService:Create(part,TweenInfo.new(5), {CFrame = tweenToPositon})
tween:Play()
tween:Completed:Wait()
runService.Stepped:Connect(function()
if (part.Position - character.HumanoidRootPart.Position).Magnitude < 9 then
part.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
end
end)
end)
local runService = game:GetService(“RunService”)
game.Players.PlayerAdded:Connect(function(player)
task.wait(5)
local character = player.Character or player.CharacterAdded:Wait()
local part = script.Parent
runService.Stepped:Connect(function()
if (part.Position - character.HumanoidRootPart.Position).Magnitude < 9 then
part.CFrame = character.HumanoidRootPart.CFrame * CFrame.new(0,0,-2)
end
end)
end)