Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago

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

Example:

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

0
It depends how you want to make it move back and forth if you want it to transition smoothly or teleport..... KingLoneCat 2642 — 8y

1 answer

Log in to vote
0
Answered by
Hero_ic 502 Moderation Voter
8 years ago

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

Ad

Answer this question