#What you could do?
Don't use functions, just use a loop! Use CFrame instead of Position, it's better for moving parts.
#CFrame
CFrame or Coordinate Frame is a data type that represents a position and orentation in 3D space, meaning that you can set the part's Position and Rotation at the same time.
Part.CFrame = CFrame.new(12,3,6.32)
Part.CFrame = Part.CFrame * CFrame.Angles(0,0,math.rad(90))
Part.CFrame = CFrame.new(12,3,6.32) * CFrame.Angles(0,0,math.pi/2)
#How would you loop them together?
Use a while loop like you've already done but instead of while true you can replace true with anything as long as it equals true, it'll run. For example:
while a == 1 do
wait()
end
while 1 do
wait()
end
while Part.BrickColor == BrickColor.new("White") do
wait()
end
while not false do
wait()
end
while wait() do
end
So knowing that while wait() do works, we can implement that into our code to make an infinite looping code that run every 1 second: while wait(1) do.
#Final Product
I removed the functions and moved those inside the loop.
Cube = script.Parent
while wait(1) do
Cube.CFrame=CFrame.new(22, 0.1, 66)
wait(1)
Cube.CFrame=CFrame.new(22, 0.1, 28)
end
Hope it helps!
4 comments
Did you even read both answers... If you do position if a person is standing where the part is, it'll teleport ontop of the person. I wrote that answer in 40 minutes... Gets me so angry.
I'm not saying to accept mine or anything, but I feel as if you didn't even glance at my answer.
I did read both answers, I just saw the first one and tried it, and it worked. I apologize for wasting your time :(
I just wanted to know if you read both. Since I know you read it it's not a waste of time! You're good don't worry!