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

Hi,A Little Help Here? Moving Brick Back And Forth

How to script a thing that moves back and forth..

Example:

Position------> (Then it go back to its position) Position<------

1 comment

0

It depends how you want to make it move back and forth if you want it to transition smoothly or teleport.....

1 answer

You can use CFrame to go to the coordinates then go to the ones before by placing two blocks and when touched turn a bool value on so a local script can loop

--example of looping
while wait(1) do --change the 1 to any time you like
	if YOURBOOLVALUE == true then --get the boolvalue and see if its true
		if bah == false then --bah is a random local value just set it to false first
			player.Character.Torso.CFrame = workspace.YOUROBJECT.CFrame 
			bah = true--if you use a model do YOUROBJECT.PrimaryPart.CFrame
		else
			player.Character.Torso.CFrame = workspace.YOURTOUCHOBJECT.CFrame 
			bah = false--if you use a model do YOURTOUCHOBJECT.PrimaryPart.CFrame
		end
	end	
end

Just so you know I will not provide all the scripts as I am just giving examples you will need to do a lot on your own. If this helped please accept :D

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