# This script was written by Cromis. # This script requires the plug-ins Citizens, Denizen and Sentry. # # It is a assignment script for a salesman that sells bodyguards. # To get this to work on your server put this script into your servers denizen/scripts folder. # In the section below the world script inside the default constants you will see BGSpawnLocation: # You will want to change "world" to whatever your main world is. Having it at the spawnpoint helps as # The spawn is always loaded which helps with spawning and despawning of bodyguards. # Save changes you have made to the script. # Reload denizen scripts with /denizen reload scripts. # Then select the npc you wish to sell the bodyguards and give it the assignment BgSalesMan. # After that you are all set. I would recommend you read through the first little bit of these comments # Before putting this on your live server. # # # With this script the player is limited to one bodyguard. If you wish to have more you can either edit this script if you know how # Or wait for me to get around to making a new script for that which I will link in the description when its complete. # If you know how feel free to use this script/edit as you wish alls I ask is you give me credit. # This is the world script that handles the spawning and despawning of bodyguards. # This helps prevent having a bulk of bodyguards standing in the same area which will be # Whatever you have the spawnpoint set to which is the world spawn by default. # This is the format script for the script to use. # Remove the # on the next 3 lines if you do not have a format code #F1: # type: format # format: <&co> BodyguardWS: type: world debug: false events: on player join: # When a player joins the server it checks if the have any of the bodyguard flags. - if { # If the player has the flag bodyguard1 which is the non respawning bodyguard it will follow this if path. - if { - wait 1s # This is where the npc is spawned back in so it can be used again. - ^spawn # Now to select the npc to give it back everything it needs. - ^execute as_server "npc sel " - if != { - narrate "ERROR: Npc number does not match selected Npc Please contact an admin." - queue clear } else { # First to give back the sentry trait - if ! { - ^execute as_server "trait sentry" } # Turning off sentry criticals - ^execute as_server "sentry criticals false" # Now to set it so it doesnt resapwn after its death as this bodyguard type does not respawn - ^execute as_server "sentry respawn -1" # Keep that bodyguard from following so close! - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard while in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard will heal. - ^execute as_server "sentry healrate 10" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # If the player has the flag BGGuarding it will have the sentry guard the player - if { # Tells the bodyguard to start guarding the player. - ^execute as_server "sentry guard " } } # If the player has the flag bodyguard2 which is the bodyguard that respawns after 5 minutes it will follow this if path. } else if { - wait 1s # Spawn in the bodyguard so it can be used. - ^spawn # Selects the bodyguard to apply the changes it needs - ^execute as_server "npc sel " - if != { - narrate "ERROR: Npc number does not match selected Npc Please contact an admin." - queue clear } else { # First to give back the sentry trait - if ! { - ^execute as_server "trait sentry" } # Turning off sentry criticals - ^execute as_server "sentry criticals false" # Sets the respawn after death to 5 minutes. - ^execute as_server "sentry respawn 300" # Sets the follow distance to 5 so it doesnt follow the player so close. - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard while in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard will heal. - ^execute as_server "sentry healrate 10" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # If the player has the flag BGGuarding it will have the sentry guard the player - if { # Tells the bodyguard to start guarding the player. - ^execute as_server "sentry guard " } } # If the player has the flag bodyguard2 which is the bodyguard that respawns after 5 minutes it will follow this if path. } else if { - wait 1s # Spawns in the bodyguard so it can be used. - ^spawn # Selects the bodyguard so it can be given back its stats/trait - ^execute as_server "npc sel " - if != { - narrate "ERROR: Npc number does not match selected Npc Please contact an admin." - queue clear } else { # First to give back the sentry trait - if ! { - ^execute as_server "trait sentry" } # Turning off sentry criticals - ^execute as_server "sentry criticals false" # Sets the Bodyguards armor to a base value of 2. Shhhh. - ^execute as_server "sentry armor 2" # Sets the bodyguard to respawn 1 second after its death. - ^execute as_server "sentry respawn 1" # Sets the follow distance to 5 so it dosent follow so close. - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard while in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard will heal. - ^execute as_server "sentry healrate 5" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # If the player has the flag BGGuarding it will have the sentry guard the player - if { # Tells the bodyguard to start guarding the player. - ^execute as_server "sentry guard " } } } } on player quits: # When the player quits if they have they bodyguard flag it will do whats in this if statement - if { # The Bodyguard will be selected - execute as_server "npc sel " - if { # The sentry trait is removed so it can be despawned - execute as_server "trait sentry" } # The Bodyguard is despawned - execute as_server "npc despawn" } BodyguardSalesMan: type: assignment debug: false # This is where most of the things you would want to change will be. default constants: # This is the format the npc will take when it talks to you change it to the format script you use. # If you don't use a format script I recommend you make one it makes things pretty and so much easier. http://mcmonkey.org/denizen/tuts/format # Or you can go through this script and remove every "format:" in this script along with the NpcFormat line below this. NpcFormat: F1 # If you want bodyguards to get involved in pvp set this to true. BodyGuardPvp: false # This is the location the bodyguard will spawn in. # I recommend you put this at the server spawn by changing "world" to your servers world name or change it to . # If you put it to the bodyguards will spawn where the player is standing but I recommend you use the world spawn. # If the location is in a unloaded area it can cause issues. BGSpawnLocation: # This is the cost of the bodyguard that does not re-spawn. Change it to whatever price you wish. BodyGuardCost: 20 # This is the cost of the bodyguard that re-spawns after 5 minutes. Change it to whatever price you wish. BodyGuardRespawnCost: 2000 # This is the cost of the bodyguard that re-spawns after 1 second. Change it to whatever price you wish. BodyGuardInstant: 20000 # Below this is the equipment the bodyguards will use. # This is the weapon the bodyguards will use a knockback 2 diamond sword change it if you wish. BodyGuardWeapon: hand:i@BodyguardSword # This is the helmet the bodyguards will use change it to whatever you like. BodyGuardHelm: head:i@DIAMOND_HELMET # This is the chestplate the bodyguards will use change it to whatever you like. BodyGuardChest: chest:i@DIAMOND_CHESTPLATE # This is the platelegs the bodyguards will use change it to whatever you like. BodyGuardLegs: legs:i@DIAMOND_LEGGINGS # This is the boots the bodyguards will use change it to whatever you like. BodyGuardBoots: boots:i@DIAMOND_BOOTS # I would not recommend changing anything past this point unless you know what you are doing/changing. interact scripts: - 10 BgSalesMan # This is The script the npc that sells the bodyguards uses. BgSalesMan: type: interact steps: 1: click trigger: script: # If the player has the bodyguard that respawns after 5 minutes they may want to eventually upgrade # Previously players were not able to upgrade the bodyguards with this script, now they can. # If the player has the flag for the bodyguard that respawns after 5 minutes it will zap them to the upgrade step - if { # Tells the player how much it will cost to upgrade the bodyguard. Yay math. - narrate format: "It will cost $]> to upgrade your bodyguard." - wait 1 - narrate format: "Speak to me again when you are ready to upgrade your bodyguard." - zap step:BGUpgrade # If the player already has a bodyguard they will not be able to get another. } else if { - narrate format: "You already have a bodyguard, Come back if he dies." } else if { - narrate format: "You already have a bodyguard, Come back if he dies." } else { # If the player does not have a bodyguard already the npc will let the player know what kind of bodyguards he is selling. - narrate format: "Hello Welcome to my shop." - wait 1 - narrate format: "As of this moment I only have three types of bodyguard available." - wait 1 - narrate format: "Would you like to hire a normal bodyguard for $?" - wait 1 - narrate format: "Or would you like one that respawns for $ or one that respawns instantly for $?" } # Now the npc will wait for a little bit for the player to type in chat which guard it wants. chat trigger: # If the player wants a bodyguard that does not respawn after death they will say "normal" in chat near the salesman. 1: trigger: I am interested in purchasing a /normal/ bodyguard. script: # At this point the salesman will let the player know the cost of the bodyguard. - engage - narrate format: "Alright that will be $." # Now it checks if the player has enough for the bodyguard. - if < { # If the player does not have enough money the npc will tell the player to come back when they have enough cash. - narrate format: "You do not have enough money, please come back when you have enough." - disengage } else { # If the player has enough money the salesman will now take that amount from them. - take money qty: # The player is now flagged with the Bodyguard1 flag the flag for a non respawning bodyguard. - flag player Bodyguard1 # Now to create the npc that will soon be the players bodyguard. - create player BodyGuard save:BodyGuard # Flagging the player with the npc number this helps a lot with selecting the npc later on. - flag player Bodyguard: # Spawn in the bodyguard at the servers spawn or wherever you changed its spawnpoint to. - ^spawn # Going back to what I just said now to select the npc that will be the bodyguard for the player. - ^execute as_server "npc select " # Time to give it the sentry trait. # Later on I plan on removing the need for the sentry plug-in just not now. - ^execute as_server "trait sentry" # Time to give it some equipment first the weapon. - ^equip # Now for the helmet. - ^equip # Now for the chestplate. - ^equip # Now for the platelegs. - ^equip # And finally the boots. - ^equip # Giving the bodyguard a view range of 15 it will attack any target in this range - ^execute as_server "sentry range 15" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # Since this bodyguard does not respawn after death we set its respawn timer to -1 so it does not respawn. - ^execute as_server "sentry respawn -1" # Sets the distance the bodyguard will follow the player to 5 that way they do not keep standing in the players face. - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard while in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard will heal. - ^execute as_server "sentry healrate 10" # This is where the bodyguard is given the assignment that controls it. - ^execute as_server "npc assignment --set BodyguardAssignment" # Giving the player ownership of the npc. - ^execute as_server "npc owner " # Now to tell the bodyguard to guard the player. - ^execute as_server "sentry guard " # Flagging the player with the BGGuarding flag which will help later on. - ^flag player BGGuarding # Letting the player know that they have given the salesman the cost of the bodyguard - narrate "You give $" - wait 2 # Now to explain to the player how to use their new bodyguard. - narrate format: "Bodyguards have a few interactions." - wait 2 - narrate format: "Right click on him to enter order mode." - wait 2 - narrate format: "He will tell you what interactions he has." - wait 2 - narrate format: "Type in chat the option you wish to use." - wait 2 - narrate format: "If you wish to exit order mode simply right click him again." # Letting the player know they now own the bodyguard until its death. - narrate format: "He is yours untill he dies, be safe out there." - disengage } 2: # If the player wants a bodyguard that respawns after 5 minutes they will say "respawns". trigger: I am interested in purchasing a bodyguard that /respawns/. script: - engage # Tells the player the price of the bodyguard. - narrate format: "Alright that will be $." # If the player does not have enough money the salesman will tell the player to come back when they have the money. - if < { - narrate format: "You do not have enough money, please come back when you have enough." - disengage # If the player has enough money the salesman will now take the cost of the bodyguard from the player. } else { - take money qty: # Gives the player the flag for the bodyguard that repsawns after 5 minutes which helps later on. - flag player Bodyguard2 # Now to create the npc that will soon be the players bodyguard. - create player BodyGuard save:BodyGuard # Flags the player with the number of the npc that will soon be the players bodyguard which helps later on. - flag player Bodyguard: # Spawn in the bodyguard at the servers spawn or wherever you changed its spawnpoint to. - ^spawn # Selects the npc that will soon be the players bodyguard. - ^execute as_server "npc select " # Time to make the npc into a bodyguard. - ^execute as_server "trait sentry" # Time to give it some equipment first the weapon. - ^equip # Now for the helmet. - ^equip # Now for the chestplate. - ^equip # Now for the platelegs. - ^equip # And finally the boots. - ^equip # Giving the bodyguard a view range of 15 it will attack any target in this range - ^execute as_server "sentry range 15" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # Sets the bodyguards to respawn 5 minutes after its death. - ^execute as_server "sentry respawn 300" # Setting the follow range to 5 so it doesnt follow the player too close. - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard to 1 while in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard will heal. - ^execute as_server "sentry healrate 10" # Gives the bodyguard the assignment that controls it. - ^execute as_server "npc assignment --set BodyguardAssignment" # Gives ownership of the bodyguard to the player - ^execute as_server "npc owner " # Tells the bodyguard to guard the player. - ^execute as_server "sentry guard " # Flags the player with the BGGuarding flag which helps later. - ^flag player BGGuarding # Lets the player know that they have given the salesman the price of the bodyguard. - narrate "You give $" # Now to explain to the player how to use their new bodyguard. - narrate format: "Bodyguards have a few interactions." - wait 2 - narrate format: "Right click on him to enter order mode." - wait 2 - narrate format: "He will tell you what interactions he has." - wait 2 - narrate format: "Type in chat the option you wish to use." - wait 2 - narrate format: "If you wish to exit order mode simply right click him again." # Lets the player know the bodyguard will respawn 5 minutes after its death. - narrate format: "Your bodyguard will respawn after 5 minutes if it dies." - disengage } 3: # If the player wants the bodyguard that respawns instantly the player will say "instantly" in chat. trigger: I am interested in purchasing a bodyguard that /instantly/ respawns. script: - engage # Tells the player the cost of the bodyguard. - narrate format: "Alright that will be $." # If the player does not have enough money for the bodyguard the salesman will tell the player to come back when they have enough. - if < { - narrate format: "You do not have enough money, please come back when you have enough." - disengage # If the player does have enough money the salesman will take the price of the bodyguard from the player. } else { - take money qty: # Gives the player the flag for the bodyguard that respawns instantly which will help out later. - flag player Bodyguard3 # Creates the npc that will soon be the players bodyguard. - create player BodyGuard save:BodyGuard # Flags the player with the bodyguards npc number which will help with selecting the bodyguard later on. - flag player Bodyguard: # Spawn in the bodyguard at the servers spawn or wherever you changed its spawnpoint to. - ^spawn # Selects the soon to be bodyguard. - ^execute as_server "npc sel " # Gives the bodyguard the sentry trait. - ^execute as_server "trait sentry" # Gives the bodyguard some extra armor shhhhh dont let them know this one is stronger. - ^execute as_server "sentry armor 2" # Time to give it some equipment first the weapon. - ^equip # Now for the helmet. - ^equip # Now for the chestplate. - ^equip # Now for the platelegs. - ^equip # And finally the boots. - ^equip # Giving the bodyguard a view range of 15 it will attack any target in this range - ^execute as_server "sentry range 15" # Now to tell the bodyguard to attack any monster within its range. - ^execute as_server "sentry target add entity:monster" # Adding pigmen to the ignore list so they don't go aggroing them. - ^execute as_server "sentry ignore add entity:pig_zombie" # If BodyGuardPvp is set to false the bodyguard will be told to ignore players. - if == false { - ^execute as_server "sentry ignore add entity:player" # If BodyGuardPvp is set to true it will remove players from the ignore list. # If bodyguards do not fight players you might want to check the sentry config. } else { - ^execute as_server "sentry ignore remove entity:player" } # This is where we make the bodyguard respawn 1 second after its death yeah thats right 1 second. - ^execute as_server "sentry respawn 1" # Sthap following so close! - ^execute as_server "sentry follow 5" # Sets the speed of the bodyguard while its in combat. - ^execute as_server "sentry speed 1.0" # Sets how fast the bodyguard heals. - ^execute as_server "sentry healrate 5" # Gives the bodyguard the assignment that controls it. - ^execute as_server "npc assignment --set BodyguardAssignment" # Sets the player as the owner of the bodyguard. - ^execute as_server "npc owner " # Tels the bodyguard to start guarding the player. - ^execute as_server "sentry guard " # Flags the player with the BGGuarding flag which helps out later. - ^flag player BGGuarding # Tells the player they have given the salesman the price of the bodyguard. - narrate "You give $" # Now to explain to the player how to use their new bodyguard. - narrate format: "Bodyguards have a few interactions." - wait 2 - narrate format: "Right click on him to enter order mode." - wait 2 - narrate format: "He will tell you what interactions he has." - wait 2 - narrate format: "Type in chat the option you wish to use." - wait 2 - narrate format: "If you wish to exit order mode simply right click him again." - wait 2 # Lets the player know the bodyguard will respawn right away. - narrate format: "Your bodyguard will respawn right away if it dies." - disengage } 4: # If the player does not want a bodyguard they will say "no" in chat. trigger: /No/, I dont want a bodyguard right now script: - engage # The salesman will choose from one of these to tell the player. - random { - narrate format: "Alright come back if you change your mind." - narrate format: "You know where to find me if you get yourself in over your head" } - disengage # This part handles the upgrade process between the 5 minute and 1 second respawning bodyguards. BGUpgrade: click trigger: script: # Asks the player if they wish to upgrade the bodyguard and tells them the cost. - narrate format: "Do you wish to upgrade your bodyguard for $]>?" chat trigger: 1: # If the player wants to upgrade the bodyguard they say "yes" in chat near the salesman. trigger: /Yes/ I would like to upgrade my bodyguard now. script: - engage # Checks if the player has enough money.F - if < ]> { # If they don't it asks them to come back when they have enough money. - ^narrate format: "You do not have enough money please come back when you do." - disengage # If they do have enough money the salesman tells them the cost and the player pays the salesman that amount. } else { - ^narrate format: "Alright that will be $]>" - ^take money qty:]> # Selects the soon to be bodyguard. - ^execute as_server "npc sel " # Remove Bodyguard2 flag from the player. - flag player Bodyguard2:! # Gives the player the bodyguard3 flag. - flag player Bodyguard3 # Gives the bodyguard some extra armor shhhhh dont let them know this one is stronger. - ^execute as_server "sentry armor 2" # Giving the bodyguard a view range of 15 it will attack any target in this range - ^execute as_server "sentry range 15" # This is where we make the bodyguard respawn 1 second after its death yeah thats right 1 second. - ^execute as_server "sentry respawn 1" # Sets how fast the bodyguard heals. - ^execute as_server "sentry healrate 5" - disengage } 2: # If the player does not wish to upgrade the bodyguard yet they say "no" near the salesman. trigger: /No/ I would not like to upgrade my bodyguard yet. script: - narrate format: "Alright come back if you change your mind." # This is the assignment script that controls the bodyguards BodyguardAssignment: type: assignment debug: false default constants: # This is the format the npc will take when it talks to you change it to the format script you use. # If you don't use a format script I recommend you make one it makes things pretty and so much easier. http://mcmonkey.org/denizen/tuts/format # Or you can go through this script and remove every "format:" in this script along with the NpcFormat line below this. NpcFormat: F1 interact scripts: - 10 BgInteractions actions: on death: # If the bodyguard dies the following will happen. # Remember the flag for the bodyguard that does not respawn? Time to use it. - if { # Lets the player know the bodyguard has died. - narrate " Your bodyguard has died!" targets: # Removes the bodyguard flag so they can purchase another. - flag player Bodyguard:! # Basicly the same thing as above. - flag player Bodyguard1:! # Look another flag to remove. - flag player BGGuarding:! # If the player has the flag for the bodyguard that reaspawns after 5 minutes it will tell the player the bodyguard has died. } elseif { - narrate " Your bodyguard has died!" targets: # Now for the 5 minute wait. - wait 300s # Lets teleport the bodyguard to the player just incase it hasnt already. - teleport npc location: # If the player has the bodyguard that respawns instantly it will let the player know the bodyguard has died. } else { - narrate " Your bodyguard has died!" targets: # The long 1 second wait. - wait 1s # Teleports the bodyguard to the player incase it hasnt already done so. - teleport npc location: } # This is the part of the script that handels the interactions for the bodyguard with the player. BgInteractions: type: interact steps: 1: click trigger: script: # If the player does not own the bodyguard and right clicks on them it will let them know it is not their bodyguard. - if != { - narrate format: "Im sorry im not your bodyguard." # If the player does own the bodyguard the bodyguard will ask what the player what they want and enter order mode. } else { - narrate format: "What would you like me to do?" - narrate format: "Stand Guard, Follow You, Change Equipment, Rename or Reskin?" - narrate format: "Right click me again to cancel" - narrate "Entering Order Mode." - ^zap step:2 } 2: # If the player right clicks them again the bodyguard will exit order mode. click trigger: script: - narrate "Exiting Order Mode." - zap step:1 chat trigger: 1: # If the player wants the guard they will say "follow" in chat near the bodyguard. trigger: /Follow/ me. script: # Remember that BGGuarding flag earlier? Time to use it # If the player has the BGGuarding flag the bodyguard will say they are already following the player. - if { - random { - narrate format: "Im already following you silly." - narrate format: "I am already following you." - narrate format: "Uhm... Okay." } # Lets the player know order mode has ended - narrate "Exiting Order Mode." - zap step:1 # If the bodyguard is not already following the player it will let the player know it is now following them. } else { - random { - narrate format: "Alright I will follow you." - narrate format: "Do i have to?" - narrate format: "Lead the way." - narrate format: "As you wish." } # Selects the bodyguard. - ^execute as_npc "npc sel " # Tells the bodyguard to follow the player. - ^execute as_npc "sentry guard " # Gives the player the BGGuarding flag again. - ^flag player BGGuarding # Lets the player know order mode has ended. - narrate "Exiting Order Mode." - zap step:1 } 2: # If the player wants the bodyguard to stand in that spot the player will say "stand" in chat. trigger: /Stand/ here. script: - if { # Tells the player that the guard will stand in that spot. - random { - narrate format: "I will guard this spot, talk to me again if you wish for me to follow you again." - narrate format: "I will wait here for you." - narrate format: "Dont forget about me." - narrate format: "Can I atleast get a book to read while i wait?" } # Selects the bodyguard. - ^execute as_npc "npc sel " # Tells the bodyguard to stop following the player. - ^execute as_npc "sentry guard" # Removes the BGGuarding flag from the player. - ^flag player BGGuarding:! # Lets the player know order mode has ended - narrate "Exiting Order Mode." - zap step:1 # If the bodyguard is already standing guard they will let the player know. } else { - random { - narrate format: "I am already waiting here." - narrate format: "But I am not following you." - narrate format: "Uhh... Alright." } } 3: # If the player wishes to rename the bodyguard the player will say "rename" in chat near the bodyguard. trigger: Id like to /Rename/ you. script: # The bodyguard will ask what the player wishes to rename the bodyguard to. - narrate format: "Alright what would you like to rename me as?" # Lets the player know order mode has ended and rename mode has began. - narrate "Exiting Order Mode and Opening Rename Mode" - zap step:3 4: # If the player wishes to give the bodyguard a new skin they say "reskin" in chat near the bodyguard. trigger: I want to change your /Reskin/ script: # Asks the player what they wish to change the bodyguards skin to. - narrate format: "Alright what would you like to change my skin to?" # Lets the player know that order mode has exited and reskin mode has opened. - narrate "Exiting Order Mode and Opening Reskin Mode" - zap step:4 5: # If the player wishes to change the bodyguards equipment they say "equipment" in chat near the bodyguard. trigger: I want to change your /Equipment/. script: # Lets the player know if they have a bodyguard that does not respawn they will lose the equipment if it dies. - narrate format: "Keep in mind if you dont have a respawning bodyguard equipment will be lost on its death" # Selects the npc. - execute as_op "npc sel " # Puts the npc into equip mode for 30 seconds. - execute as_op "npc equip" - narrate "Equip Mode will end in 30 seconds." # The 30 second timer. - wait 30 # Disables equip mode. - execute as_op "npc equip" - zap step:1 3: chat trigger: 1: # This is where the renaming happens if they player wishes to change the bodyguards name. trigger: I want your new name to be /regex:.+/. script: # Selects the bodyguard. - execute as_server "npc sel " # Renames the bodyguard. - execute as_server "npc rename " # Lets the player know rename mode has ended. - narrate "Exiting Rename Mode." - zap step:1 4: chat trigger: 1: # This is where the reskin happens if the player whishes to change the bodyguards skin. trigger: I want you to take the skin of /regex:.+/. script: # Selecting the bodyguard. - execute as_server "npc sel " # Re-skins the bodyguard. - execute as_server "npc skin " # Lets the player know reskin mode has ended. - narrate "Exiting Reskin Mode." - zap step:1 # This is the weapon the bodyguards use A diamond sword with knockback 2 enchant. BodyguardSword: type: item material: DIAMOND_SWORD enchantments: - KNOCKBACK:2 # This is the command script used to teleport guards to a player TeleportBodyGuard: type: command debug: false name: TpGuard description: Teleports your bodyguard to you. usage: /TpGuard script: - if ! { - narrate "Error: You do not have a bodyguard." - queue clear } else != { - ^execute as_server "npc sel " - if != { - narrate "ERROR: Can not find Bodyguard Please contact a Admin." - queue clear } else { - teleport } }