Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Script Made By PoisonGhost (819680_) [Ver. 1.0]
- // This disappointingly took 13 days.
- // Prefix is ; for example, saying !cmds will not work, but ;cmds will.
- // Current Commands :
- //---------
- // ;cmds
- // ;worldedit
- // ;destroy
- // ;fill id
- // ;replace id id
- // ;copy
- // ;paste
- // ;follow
- // ;stay
- //---------
- // id means block id, for example ";fill 2" would fill a zone with grass blocks.
- // To use worldedit, say ;worldedit to enable it, then use a NON DAMAGED wooden pickaxe to set a zone.
- let toggle = false
- let pos: Position = null
- let tf = false
- let worldedit = false
- let initpos: Position = null
- let follow = false
- let msg = 0
- let blocker: Block = null
- let wepos1: Position = null
- let wepos2: Position = null
- let copos1: Position = null
- let copos2: Position = null
- let pos7: Position = null
- let pos1: Position = null
- let pos2: Position = null
- let pos3: Position = null
- let pos4: Position = null
- let pos5: Position = null
- let pos6: Position = null
- let canarrow = 0
- let horain = false
- player.onChat(";stay", function () {
- follow = false
- })
- blocks.onBlockBroken(blocks.block(Block.Sign), function () {
- if (tf == true) {
- if (blocks.testForBlock(blocks.block(Block.Air), pos1)) {
- pos = pos1
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos2)) {
- pos = pos2
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos3)) {
- pos = pos3
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos4)) {
- pos = pos4
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos5)) {
- pos = pos5
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos6)) {
- pos = pos6
- } else if (blocks.testForBlock(blocks.block(Block.Air), pos7)) {
- pos = pos7
- }
- wipesigns2222()
- if (pos == pos1) {
- tpagent2222()
- player.say("§dAgent teleported to your position")
- } else if (pos == pos2) {
- player.say("§dSurfacing...")
- surface2222()
- } else if (pos == pos3) {
- player.say("§dLighting the area...")
- light2222()
- } else if (pos == pos4) {
- player.say("§dExcavating..")
- mine222()
- } else if (pos == pos5) {
- player.say("§4§lLook up...")
- horsspawn()
- } else if (pos == pos6) {
- player.execute("xp 1L @s")
- player.say("§dGained XP.")
- } else if (pos == pos7) {
- player.say("§d§dRemoving dropped items.")
- clean()
- }
- }
- })
- // player.onChat(";select", function () { if
- // (worldedit == true) { selectBlock() } else {
- // player.say("Error: WorldEdit disabled") } })
- player.onChat(";fill", function (num1: number) {
- if (worldedit == true && wepos1 != null && wepos2 != null) {
- filler(num1)
- player.say("§2Blocks filled.")
- } else if (worldedit == true && wepos1 == null && wepos2 == null) {
- player.say("§4Error:§d Invalid zone.")
- } else {
- player.say("§4Error:§d WorldEdit disabled")
- }
- })
- player.onChat(";replace", function (num1: number, num2: number) {
- if (worldedit == true && wepos1 != null && wepos2 != null) {
- replacer(num1, num2)
- player.say("§2§dBlocks replaced.")
- } else if (worldedit == true && wepos1 == null && wepos2 == null) {
- player.say("§4Error:§d Invalid zone.")
- } else {
- player.say("§4Error:§d WorldEdit disabled")
- }
- })
- player.onChat(";copy", function () {
- if (worldedit == true && wepos1 != null && wepos2 != null) {
- copyy()
- player.say("§dSelection Copied.")
- } else if (worldedit == true && wepos1 == null && wepos2 == null) {
- player.say("§4Error:§d Invalid zone.")
- } else {
- player.say("§4Error:§d WorldEdit disabled")
- }
- })
- player.onChat(";paste", function () {
- if (worldedit == true && wepos1 != null && wepos2 != null) {
- pastey()
- player.say("§dSelection Pasted.")
- } else if (worldedit == true && wepos1 == null && wepos2 == null) {
- player.say("§4Error:§d Invalid zone.")
- } else {
- player.say("§4Error:§d WorldEdit disabled")
- }
- })
- player.onChat(";destroy", function () {
- if (worldedit == true) {
- dodestroy22()
- } else {
- player.say("§4Error:§d WorldEdit disabled")
- }
- })
- player.onItemInteracted(blocks.item(Item.WoodenPickaxe), function () {
- if (worldedit == true) {
- if (toggle == false) {
- player.say("§1Position 1 set:§d (" + player.position().add(positions.create(0, -1, 0)) + ")")
- if (wepos1 != null && blocks.testForBlock(blocks.block(Block.BlackStainedGlass), wepos1)) {
- blocks.place(0, wepos1)
- }
- wepos1 = player.position().add(positions.create(0, -1, 0))
- blocks.place(blocks.block(Block.BlackStainedGlass), wepos1)
- toggle = true
- } else {
- player.say("§1Position 2 set:§d (" + player.position().add(positions.create(0, -1, 0)) + ")")
- if (wepos2 != null && blocks.testForBlock(blocks.block(Block.BlueStainedGlass), wepos2)) {
- blocks.place(0, wepos2)
- }
- wepos2 = player.position().add(positions.create(0, -1, 0))
- blocks.place(blocks.block(Block.BlueStainedGlass), wepos2)
- toggle = false
- }
- }
- })
- player.onChat(";worldedit", function () {
- if (worldedit == false) {
- worldedit = true
- player.say("§dWorldEdit enabled")
- } else {
- worldedit = false
- player.say("§dWorldEdit disabled")
- }
- })
- function light2222() {
- blocks.fill(
- blocks.block(Block.Torch),
- positions.create(-2, 0, -2),
- positions.create(2, 0, 2),
- FillOperation.Outline
- )
- }
- function horsspawn() {
- for (let i = 0; i < 150; i++) {
- mobs.spawn(mobs.animal(AnimalMob.Horse), positions.create(0, 150, 0))
- }
- }
- player.onChat(";follow", function (msg) {
- follow = true
- })
- player.onChat(";select", function (num1, num2, num3) {
- if (worldedit == true) {
- blocker = blocks.blockById(num1)
- player.say("§1Block Selected: §d" + blocks.block(blocker))
- } else {
- player.say("§4Error:§d WorldEdit Disabled")
- }
- })
- loops.forever(function () {
- if (follow == true) {
- loops.pause(200)
- tpagent2222()
- } else {
- loops.pause(200)
- }
- })
- function dodestroy22() {
- if (wepos1 != null && wepos2 != null) {
- blocks.fill(
- blocks.block(Block.Air),
- wepos2,
- wepos1,
- FillOperation.Replace
- )
- player.say("§dZone removed")
- } else {
- player.say("§4Error:§d Invalid zone")
- }
- }
- function tpagent2222() {
- agent.teleport(positions.create(1, 0, 1), CompassDirection.West)
- }
- function mine222() {
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Stone),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Granite),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Diorite),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Gravel),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Andesite),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- blocks.replace(
- blocks.block(Block.Air),
- blocks.block(Block.Water),
- positions.create(-10, 5, -10),
- positions.create(10, 0, 10)
- )
- }
- function surface2222() {
- player.teleport(positions.createHybrid("~", "66", "~"))
- blocks.place(blocks.block(Block.Grass), positions.create(0, -1, 0))
- blocks.fill(0, positions.create(0, 1, 0), positions.create(0, 0, 0))
- }
- function wipesigns2222() {
- blocks.fill(0, pos1, pos7)
- tf = false
- }
- player.onChat(";cmds", function (msg) {
- initpos = player.position()
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(3, 0, -2)))
- pos1 = initpos.add(positions.create(3, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(2, 0, -2)))
- pos2 = initpos.add(positions.create(2, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(1, 0, -2)))
- pos3 = initpos.add(positions.create(1, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(0, 0, -2)))
- pos4 = initpos.add(positions.create(0, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-1, 0, -2)))
- pos5 = initpos.add(positions.create(-1, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-2, 0, -2)))
- pos6 = initpos.add(positions.create(-2, 0, -2))
- blocks.place(blocks.block(Block.Sign), initpos.add(positions.create(-3, 0, -2)))
- pos7 = initpos.add(positions.create(-3, 0, -2))
- tf = true
- })
- function filler(num1: number) {
- if (wepos1 != null && wepos2 != null && num1 == 0) {
- blocks.fill(
- blocks.block(blocker),
- wepos2,
- wepos1,
- FillOperation.Replace
- )
- } else if (blocker == null && wepos1 != null && wepos2 != null && num1 == 0) {
- player.say("§4Error:§d No Block Selected")
- } else if (wepos1 != null && wepos2 != null && num1 != 0) {
- blocks.fill(
- blocks.blockById(num1),
- wepos2,
- wepos1,
- FillOperation.Replace
- )
- } else {
- }
- }
- function replacer(num2: number, num1: number) {
- if (wepos1 != null && wepos2 != null && num1 == 0) {
- blocks.replace(
- blocks.blockById(num1),
- blocks.blockById(num2),
- wepos1,
- wepos2
- )
- } else if (blocker == null && wepos1 != null && wepos2 != null && num1 == 0) {
- player.say("§4Error:§d No Block Selected")
- } else if (wepos1 != null && wepos2 != null && num1 != 0) {
- blocks.replace(
- blocks.blockById(num1),
- blocks.blockById(num2),
- wepos1,
- wepos2
- )
- } else {
- }
- }
- function copyy() {
- if (wepos1 != null && wepos2 != null) {
- copos1 = wepos1
- copos2 = wepos2
- } else {
- player.say("§4Error:§d Invalid Zone")
- }
- }
- function pastey() {
- blocks.clone(copos1, copos2, player.position(), CloneMask.Masked, CloneMode.Normal)
- }
- function clean() {
- player.execute("kill @e [type=item]")
- }
- player.execute(
- "title @s title §3PoisonGhost's Sign UI Loaded"
- )
- player.execute(
- "title @s subtitle §4Say §1;cmds§4 for signs to appear"
- )
- player.say("§3PoisonGhost (819680_)'s dumb sign UI loaded.")
- player.say("§dSay§1 ;cmds§d for signs to appear")
- player.say("§dSay§1 ;worldedit§d to use worldedit")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement