Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do you make a part move infinitely then teleport back after 12s?

script.Parent.Anchored = true -- Anchored while true do

	script.Parent.Position = script.Parent.Position + Vector3.new(2,0,0)
wait() 
end
script.Parent.CFrame = CFrame.new(-146.98, 9.578, 43.66)	

There's the script I've looked up many tutorials, but could not figure it out some one please explain how to fix this????

2 answers

✓ Accepted answer

You can do

local time = 0

repeat
	wait()
	time = time + 1
	script.Parent.Position = script.Parent.Position + Vector3.new(2,0,0)
until time == 12

script.Parent.CFrame = CFrame.new(-146.98, 9.578, 43.66)    

Use a for loop that loops for 12 times and a -1 and make it in the loop change positions, that'll be like teleporting for 12 seconds.

This discussion is preserved as it was. New answers, comments, and votes are closed.