Skip to content

Instantly share code, notes, and snippets.

@Core-commits
Created July 25, 2020 10:57
Show Gist options
  • Save Core-commits/020b84b61ecc8c45ab931c05390f4fe1 to your computer and use it in GitHub Desktop.
Save Core-commits/020b84b61ecc8c45ab931c05390f4fe1 to your computer and use it in GitHub Desktop.
function moveBrick(name, interval, increment, x, y, z) {
world.bricks.find(brick => brick.name === name)
brickX = brick.position.x
brickY = brick.position.y
brickZ = brick.position.z
setInterval(function () {
for (brickX <= x; brickX+increment;) {
console.log(brick.position)
}
for (brickY <= y; brickY+increment;) {
console.log(brick.position)
}
for (brickZ <= z; brickZ+increment;) {
console.log(brick.position)
}
}, interval);
}
// How to use.
moveBrick("MyBrickName!", 0.01, 1, 100, 20, 0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment