Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- options:
- prefix: &f[&2Tycoon&f] &8>>
- version: 1.0
- command /tycoon [<text>] [<text>]:
- trigger:
- if player has permission "Tycoon.*":
- if arg 1 is "help":
- send "&f--------------[&2Tycoon&f]--------------"
- send "&a/Tycoon help &8>> &2Krijg de help pagina"
- send "&a/Tycoon shop create &8>> &2Maak een shop"
- send "&a/Tycoon shop &8>> &2Ga naar het shop gui"
- send "&a/Tycoon shop remove &8>> &2Verwijder de shop"
- send "&f--------------[&2Tycoon&f]--------------"
- if arg 1 is "shop":
- if arg 2 is "create":
- send "{@prefix} &2Succesvol een shop item gegeven."
- give player a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon"
- #send "{@prefix} &aSuccesvol de shop gemaakt!"
- #spawn Llama at player
- #set {_Llama} to last spawned Llama
- #set name of last spawned Llama to "&6Tycoon shop"
- #add "{Age:1,NoAI:1,Silent:1b,Invulnerable:1}" to nbt tag of {_Llama}
- else if arg 2 is set:
- send "{@prefix} &4Dit command is niet goed uitgevoerd, doe &c/tycoon stop create&4."
- else:
- send "{@prefix} &4Doe &c/tycoon help &4voor meer info."
- else if arg 1 is "help":
- send "&f--------------[&2Tycoon&f]--------------"
- send "&a/Tycoon help &8>> &2Krijg de help pagina"
- send "&a/Tycoon shop &8>> &2Ga naar het shop gui"
- send "&f--------------[&2Tycoon&f]--------------"
- else if arg 1 is "shop":
- send "{@prefix} &2Shop geoopent."
- on rightclick on a villager:
- wait 1 tick
- set {_world} to world of clicked entity
- set {_locX} to x-coordinate of clicked entity
- set {_locY} to y-coordinate of clicked entity
- set {_locZ} to z-coordinate of clicked entity
- open chest with 1 rows named "&6Tycoon Shop" to player
- make gui slot 0 of player with redstone dust named "&6Machine Shop" to close then run function openShop(player, "machines")
- make gui slot 8 of player with barrier named "&4Delete Shop" to run function removeShop(player, clicked entity, "%{_locX}%", "%{_locY}%", "%{_locZ}%", "%{_world}%")
- on rightclick:
- if player is holding a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon":
- set {_locX} to x-coordinate of targeted block
- set {_locY} to y-coordinate of targeted block+0.5
- set {_locZ} to z-coordinate of targeted block
- set {_block} to location of targeted block
- loop blocks in radius 5 around player:
- if location of loop-block is {_block}:
- send "{@prefix} &2Succesvol de shop gemaakt!"
- set {_gm} to gamemode of player
- if gamemode of player is not creative:
- remove 1 of tool from tool
- spawn villager at location {_locX}, {_locY}, {_locZ}
- set {_villager} to last spawned villager
- set name of last spawned villager to "&6Tycoon shop"
- add "{Profession:5,Age:1,NoAI:1,Silent:1b,Invulnerable:1}" to nbt tag of {_villager}
- add "%world of player% - %{_locX}%, %{_locY}%, %{_locZ}%" to {Tycoon::shopLocations::*}
- on death of villager:
- if attacker is a player:
- if name of villager is "&6Tycoon shop":
- set {_locX} to x-coordinate of victim
- set {_locY} to y-coordinate of victim
- set {_locZ} to z-coordinate of victim
- if {Tycoon::shopLocations::*} doesn't contain "%world of victim% - %{_locX}%, %{_locY}%, %{_locZ}%":
- stop
- else:
- remove "%world of victim% - %{_locX}%, %{_locY}%, %{_locZ}%" from {Tycoon::shopLocations::*}
- send "{@prefix} &2Succesvol de shop verwijderd!" to attacker
- play "block_wood_hit" to attacker at volume 10
- set {_item} to false
- loop items in attacker's inventory:
- if loop-item is a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon":
- set {_item} to true
- stop loop
- else:
- set {_item} to false
- if {_item} is false:
- give attacker a book named "&6Create Shop" with lore "&5Klik om een shop te maken - Tycoon"
- every 1 tick:
- loop all players:
- if loop-player is holding a paper named "&6Dirt machine" with lore "&5Tycoon Machine":
- set {_block} to location of targeted block of loop-player
- loop blocks in radius 5 around loop-player:
- if location of loop-block is {_block}:
- set {_world} to world of loop-player
- set {_x} to x-coordinate of targeted block of loop-player
- set {_y} to y-coordinate of targeted block of loop-player + 1
- set {_z} to z-coordinate of targeted block of loop-player
- set {_y2} to y-coordinate of targeted block of loop-player
- #set {tycoon::targetedBlock::%loop-player%} to location of targeted block of loop-player
- if {tycoon::targetedBlock::%loop-player%} is "%{_x}%, %{_y2}%, %{_z}%, %{_world}%":
- stop loop
- if {tycoon::targetedBlock::%loop-player%} is "%{_x}%, %{_y}%, %{_z}%, %{_world}%":
- stop loop
- set {tycoon::targetedBlock::%loop-player%} to "%{_x}%, %{_y2}%, %{_z}%, %{_world}%"
- send "%{tycoon::targetedBlock::%loop-player%}%" to loop-player
- drawScematic(loop-player, "dirt_machine", "%{_x}%", "%{_y}%", "%{_z}%")
- #drawScematic(loop-player, "dirt_machine")
- function drawScematic(p: Player, t: String, x: String, y: String, z: String):
- if {_t} is "dirt_machine":
- set {_world} to world of {_p}
- set block at location ({_x} parsed as a number), ({_y} parsed as a number), ({_z} parsed as a number) in world {_world} to glass
Add Comment
Please, Sign In to add comment