11:37 PM 28/03/2021
Easy stuff!
First, get all the bricks named "killbrick"
let killbricks = world.bricks.filter(brick => brick.name == "killbrick")
Then, we just need to listen for every time a player touches one of those bricks using brick.touching
(See documentation, https://brickhill.gitlab.io/open-source/node-hill/classes/brick.html#touching)
We want to kill the player which touches the brick, so this is what we do
killbricks.forEach(killbrick => { // For every killbrick
killbrick.touching(plr => { // When a player touches the brick
plr.kill() // Kill that player
})
})
First, get all the bricks named "killbrick"
let killbricks = world.bricks.filter(brick => brick.name == "killbrick")
Then, we just need to listen for every time a player touches one of those bricks using brick.touching
(See documentation, https://brickhill.gitlab.io/open-source/node-hill/classes/brick.html#touching)
We want to kill the player which touches the brick, so this is what we do
killbricks.forEach(killbrick => { // For every killbrick
killbrick.touching(plr => { // When a player touches the brick
plr.kill() // Kill that player
})
})
02:32 AM 29/03/2021
Quote from Noah Cool Boy , 11:37 PM 28/03/2021Thanks so much!
Easy stuff!
First, get all the bricks named "killbrick"
let killbricks = world.bricks.filter(brick => brick.name == "killbrick")
Then, we just need to listen for every time a player touches one of those bricks using brick.touching
(See documentation, https://brickhill.gitlab.io/open-source/node-hill/classes/brick.html#touching)
We want to kill the player which touches the brick, so this is what we do
killbricks.forEach(killbrick => { // For every killbrick
killbrick.touching(plr => { // When a player touches the brick
plr.kill() // Kill that player
})
})
03:46 PM 31/03/2021
Quote from Jazc11 , 02:32 AM 29/03/2021you can use this with other obstacles like moving parts and such so knowing how to specifically pick bricks named one thing is useful, so if you learn a few basic other functions you can easily change it around to make some other obstacles, you should tryQuote from Noah Cool Boy , 11:37 PM 28/03/2021
Easy stuff!
First, get all the bricks named "killbrick"
let killbricks = world.bricks.filter(brick => brick.name == "killbrick")
Then, we just need to listen for every time a player touches one of those bricks using brick.touching
(See documentation, https://brickhill.gitlab.io/open-source/node-hill/classes/brick.html#touching)
We want to kill the player which touches the brick, so this is what we do
killbricks.forEach(killbrick => { // For every killbrick
killbrick.touching(plr => { // When a player touches the brick
plr.kill() // Kill that player
})
})
Thanks so much!