Advertisement
Guest User

Bot Spawn Script

a guest
Nov 18th, 2020
2,274
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let bot = new Bot("Bot") //This will create the bot
  2.  
  3. let outfit = new Outfit(bot) //What the bot will look like
  4.     .body("#0d9436")
  5.     .torso("#C60000")
  6.     .head("#F3B700")
  7.     .rightArm("#F3B700")
  8.     .leftArm("#F3B700")
  9.     .rightLeg("#76603F")
  10.     .leftLeg("#76603F")
  11.     .face()
  12.     .hat1()
  13.  
  14. let Spawn = world.bricks.find(brick => brick.name === "botspawn") //bot will spawn on a brick that is named botspawn
  15. Game.newBot(bot)
  16. bot.setPosition(new Vector3(Spawn.position.x + Math.floor(Math.random() * 1) + 1, Spawn.position.y + Math.floor(Math.random() * 1) + 1, Spawn.position.z))
  17.  
  18. bot.setInterval(() => {
  19.     let target = bot.findClosestPlayer(30)
  20.  
  21.     if (!target) return bot.setSpeech("") // if there isn't a player nearby do
  22.  
  23.     bot.setSpeech("Hello there!")  // if there is a player nearby do
  24. }, 10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement