treadmill script

x1x1
Joined 10/06/2021
Posts 129
05:40 PM 30/05/2022
i wanna make a part that acts like a treadmill

but idk how pls give me help!


[SERB] Embarassed
Joined 26/01/2022
Posts 5,897
05:43 PM 30/05/2022
thats u who should be telling me with that title


[RG] Rainbow Games
Joined 02/03/2019
Posts 159
01:23 AM 04/06/2022
ngl I have no idea how to do thay


[RG] Rainbow Games
Joined 02/03/2019
Posts 159
01:23 AM 04/06/2022
Quote from Rainbow Games , 01:23 AM 04/06/2022
ngl I have no idea how to do thay
that*———-


Floppys
Joined 18/05/2022
Posts 23
12:28 AM 05/06/2022
You can make it by setting the player’s speed to 0 to make it look like they are walking on the treadmill. And add a part that set the player’s speed back to normal once they are off the treadmill


brickboyoze
Joined 25/08/2021
Posts 58
02:44 AM 29/06/2022
velocity on bricks isnt available in the current client, however in the new client it should be possible.


[gpi] GPI
Joined 11/10/2018
Posts 1,186
03:11 AM 29/06/2022
you could probably do it using player.position and player.setPosition doing something like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})



^ i have not bug-checked the script so it probably has an error lol


[gpi] GPI
Joined 11/10/2018
Posts 1,186
03:23 AM 29/06/2022
Quote from GPI , 03:11 AM 29/06/2022
you could probably do it using player.position and player.setPosition doing something like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})



^ i have not bug-checked the script so it probably has an error lol
just realised i forgot about this but u need to make it a function and put it in a setInterval loop


[gpi] GPI
Joined 11/10/2018
Posts 1,186
03:26 AM 29/06/2022
Quote from GPI , 03:23 AM 29/06/2022
Quote from GPI , 03:11 AM 29/06/2022
you could probably do it using player.position and player.setPosition doing something like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})



^ i have not bug-checked the script so it probably has an error lol

just realised i forgot about this but u need to make it a function and put it in a setInterval loop
it'd be more like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
setInterval(50, function() {
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})}


[Brick] 1nator
Joined 11/10/2017
Posts 11,114
02:54 PM 30/06/2022
Quote from GPI , 03:26 AM 29/06/2022
Quote from GPI , 03:23 AM 29/06/2022
Quote from GPI , 03:11 AM 29/06/2022
you could probably do it using player.position and player.setPosition doing something like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})



^ i have not bug-checked the script so it probably has an error lol

just realised i forgot about this but u need to make it a function and put it in a setInterval loop

it'd be more like:

let brick = new Brick(new Vector3(0, 0, 0), new Vector3(5, 5, 5), "#f54242");
let pos;
let subtract = [0,0.1,0] //the way you want the player to move backwards (btw if your thinking of it with mc-like coords its x,z,y not x,y,z)
setInterval(50, function() {
brick.touching((player) => {
player.setPosition(player.position[0]-subtract[0])
player.setPosition(player.position[1]-subtract[1])
player.setPosition(player.position[2]-subtract[2])
})}
That would be very unnatural but would work i suppose

1