local plr = game.Players.LocalPlayer local character = plr.Character or plr.CharacterAdded:Wait() local humanoidRootPart = character:WaitForChild("HumanoidRootPart") local TweenService = game:GetService("TweenService") -- Tween to move from Position 1 (start) to Position 2 (end) local startPosition = CFrame.new(-26, 4, 165) -- Start position local endPosition = CFrame.new(18, 4, 178) -- End position -- Function to create and play tween local function teleportLoop() humanoidRootPart.CFrame = startPosition -- Teleport back to start position wait(5) -- Wait for 5 seconds before starting the tween local tweenInfo = TweenInfo.new( 5, -- Time to complete the tween Enum.EasingStyle.Linear, Enum.EasingDirection.In ) local tween = TweenService:Create(humanoidRootPart, tweenInfo, {CFrame = endPosition}) tween:Play() -- When the tween completes, teleport back and start again tween.Completed:Connect(function() teleportLoop() -- Recursively call the function to loop end) end teleportLoop() -- Start the teleport and tween loop