Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Skript Make By Enrico Fajar Ferdiansyah
- #No Copy Right Please :) ?
- #
- #Depencies:
- #- Skript
- #- Skquery
- #- Skrayfall
- #- Citizens
- #- Vault
- #Tutorial [ADMIN]
- #1. Command /ds create <NamaNPC> <NPCMessage>
- #2. Hold Item to add it to Sell able in the NPC
- #3. Rightclick on The NPC then the item should be added on list sellable items
- #4. Test it by putting the item on the blank center of the GUI
- #5. Click The Green Wool then the item should be sold
- #Tutorial [MEMBER]
- #1. Right Click To The NPC
- #2. Put Item To The Blank Center Of The GUI
- #3. CLick The Green WOOL !
- #INFO:
- #Max sellable item in one npc = 8 different
- #No rename NPC ! No Edit Item in the NPC , if you get wrong item , just delete the npc by /ds delete
- #gunakan /ds untuk melihat list command
- #Support all Custom Items !
- options:
- pref: &r &r%{_c3}%
- pref2: &8&l[%{_c5}%>&8&l]%{_c2}%
- versi: 1.1
- #Message Section
- dscreate: /ds create <NPCname> <NPCMessage> &8- %{_c4}%Create New NPC
- dsdelete: /ds delete <NPCname> &8- %{_c4}%Delete An NPC
- dstype: /ds type <NPCname> <Type> &8- %{_c4}%Change Type Of Npc
- dsadd: /ds add <NPCname> <Price> &8- %{_c4}%Add Item To Sellable In NPC
- dsinfo: /ds info <NPCname> &8- %{_c4}%Info Of An NPC
- dslist: /ds list &8- %{_c4}%List Of all Registered NPC
- dsreload: /ds reload &8- %{_c4}%Reload The Skript
- dserrname: Please Insert NPC Name
- dserrprice: Please Insert Item Price
- dserronepiece: Please Hold Just One Item (Not Stack)
- dserrair: Please Hold An item To sellable
- dserrmsg: Please Insert NPC Message
- dserritemext: This Item Already Exist In This NPC
- dserrnameexs: Npc With That Name Already Exist
- dserranother: Please Pick Another Name Instead
- dsnpccreated: Npc With Name %{_c1}%%arg 2% %{_c3}%Succesfully Created
- dsnpcmsg: Npc Message For %{_c1}% %{_c3}%This NPC is &e""%{_c2}%%arg 3%&e""
- dsnpcnotfound: There's No NPC named %{_c1}%%arg 2%
- dsnpcdeleted: Npc Named %{_c4}%%arg 2% %{_c3}%Succesfully Deleted
- dsnonpc: None Npc has been created
- dscreatepls: Please Create One using
- dsnpclists: %{_c4}%List Of Deluxe Sell NPC created
- dsnoitem: There is no item sell on this NPC
- dsitemlists: List OF Sellable Item On This NPC
- #Message Section
- #
- #
- #Jangan Ganti Dibawah Ini
- npcvar: {ds.npc::*}
- npcvarl: {ds.npc::%{_s}%}
- itemvar: {ds.item.%loop-value%::*}
- #Jangan Ganti Diatas Ini
- #
- #
- on script load:
- send "&7[&6Skript&7] &aDeluxeSell &7V.{@versi} &fActivated" to console
- on script unload:
- send "&7[&6Skript&7] &cDeluxeSell &7V.{@versi} &fDisabled" to console
- command /deluxesell [<text>] [<text>] [<text>]:
- aliases: ds
- trigger:
- add "a" to {_list::*}
- add "b" to {_list::*}
- add "c" to {_list::*}
- add "6" to {_list::*}
- add "d" to {_list::*}
- add "f" to {_list::*}
- add "3" to {_list::*}
- add "e" to {_list::*}
- loop 5 times:
- set {_c%loop-num%} to "&%a random element out of {_list::*}%"
- set {_c%loop-num%} to colored {_c%loop-num%}
- if player don't have permission "deluxeshop.admin":
- send "{@pref2} Kamu Tidak Mempunyai Hak"
- stop
- if arg 1 is "reset":
- loop {@npcvar}:
- delete {ds.item.%loop-value%::*}
- delete {@npcvar}
- if arg 1 is not set:
- send " "
- send "{@pref}{@dscreate}"
- send "{@pref}{@dsdelete}"
- send "{@pref}{@dstype}"
- send "{@pref}{@dsadd}"
- send "{@pref}{@dsinfo}"
- send "{@pref}{@dslist}"
- send "{@pref}{@dsreload}"
- send " "
- send "%{_c1}%&m--------------------]%{_c2}% Deluxe Sell %{_c1}%&m[--------------------"
- if arg 1 is "reload":
- player command "/sk reload %script%"
- if arg 1 is "create":
- if arg 2 is not set:
- send "{@pref2} {@dserrname}"
- send " "
- send "{@pref2} {@dscreate}"
- stop
- if arg 3 is not set:
- send "{@pref2} {@dserrmsg}"
- send " "
- send "{@pref2} {@dscreate}"
- stop
- loop {@npcvar}:
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- send "{@pref2} {@dserrnameexs}"
- send "{@pref2} {@dserranother}"
- stop
- create a citizen named "%arg 2%" at player as a player
- set {_id} to last created citizen
- add "%{_id}%.|.%arg 2%.|.%arg 3%" to {@npcvar}
- send "{@pref2} {@dsnpccreated}"
- send "{@pref2} {@dsnpcmsg}"
- if arg 1 is "delete":
- if arg 2 is not set:
- send "{@pref2} {@dserrname}"
- send " "
- send "{@pref2} {@dsdelete}"
- stop
- loop {@npcvar}:
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- player command "/npc sel %{_a::1}%"
- player command "/npc rem"
- remove loop-value from {@npcvar}
- send "{@pref2} {@dsnpcdeleted}"
- stop
- send "{@pref2} {@dsnpcnotfound}"
- if arg 1 is "type":
- if arg 2 is not set:
- send "{@pref2} {@dserrname}"
- send " "
- send "{@pref2} {@dsdelete}"
- stop
- loop {@npcvar}:
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- player command "/npc sel %{_a::1}%"
- player command "/npc type %arg 3%"
- stop
- send "{@pref2} {@dsnpcnotfound}"
- if arg 1 is "list":
- if {@npcvar} is not set:
- send "{@pref2} {@dsnonpc}"
- send "{@pref2} {@dscreatepls}"
- send "{@pref2} {@dscreate}"
- stop
- send "{@dsnpclists}"
- send " "
- loop {@npcvar}:
- set {_n::*} to loop-value split at ".|."
- send "{@pref2} %{_c1}%%{_n::2}%"
- if arg 1 is "info":
- if {@npcvar} is not set:
- send "{@pref2} {@dsnonpc}"
- send "{@pref2} {@dscreatepls}"
- send "{@pref2} {@dscreate}"
- stop
- loop {@npcvar}:
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- player command "/npc sel %{_a::1}%"
- player command "/npc tp"
- send "{@pref2} NPC NAME: %{_c5}%%{_a::2}%"
- send "{@pref2} NPC ID: %{_c5}%%{_a::1}%"
- if {@itemvar} is not set:
- send "{@pref2} {@dsnoitem}"
- stop
- send "{@pref2} {@dsitemlists}:"
- loop {@itemvar}:
- add 1 to {_item}
- set {_items::*} to {ds.item.%loop-value-1%::%{_item}%} split at ".|."
- if {_items::4} is set:
- send "{@pref2} %{_item}%. %{_c1}%%{_items::1}% %{_c2}%Price: %{_items::3}%$"
- if {_items::4} is not set:
- send "{@pref2} %{_item}%. %{_c1}%%{_items::1}% %{_c2}%Price: %{_items::2}%$"
- stop
- send "{@pref2} {@dsnpcnotfound}"
- if arg 1 is "add":
- if arg 2 is not set:
- send "{@pref2} {@dserrname}"
- send " "
- send "{@pref2} {@dsadd}"
- stop
- if arg 3 is not set:
- send "{@pref2} {@dserrprice}"
- send " "
- send "{@pref2} {@dsadd}"
- stop
- set {_oks} to "%player's tool%"
- set {_ok::*} to {_oks} split at " "
- set {_ok} to {_ok::1} parsed as number
- if {_ok} is set:
- send "{@pref2} {@dserronepiece}"
- stop
- set {_arg3} to "%arg 3%"
- set {_harga} to {_arg3} parsed as number
- if {_harga} is not set:
- send "{@pref2} Price Must Be Number"
- stop
- loop {@npcvar}:
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- loop {@itemvar}:
- if "%name of player's tool%.|.%lore of player's tool%.|.%arg 3%.|.%type of player's tool%" is "%loop-value-2%":
- add 1 to {_false}
- if "%type of player's tool%.|.%lore of player's tool%.|.%arg 3%" is "%loop-value-2%":
- add 1 to {_false}
- if "%name of player's tool%.|.%arg 3%.|.%type of player's tool%" is "%loop-value-2%":
- add 1 to {_false}
- if "%type of player's tool%.|.%arg 3%" is "%loop-value-2%":
- add 1 to {_false}
- if {_false} is set:
- send "{@pref2} {@dserritemext}"
- stop
- set {_a::*} to loop-value split at ".|."
- if "%{_a::2}%" is "%arg 2%":
- if size of {@itemvar} is equal to 8:
- send "{@pref2} Maximum Sellable Item On this npc reached"
- stop
- if player is holding air:
- send "{@pref2} {@dserrair}"
- stop
- if name of player's tool is not set:
- if lore of player's tool is set:
- set {_nnhl} to true
- add "%type of player's tool%.|.%lore of player's tool%.|.%arg 3%" to {@itemvar}
- if lore of player's tool is not set:
- set {_nnnl} to true
- add "%type of player's tool%.|.%arg 3%" to {@itemvar}
- if name of player's tool is set:
- if lore of player's tool is set:
- set {_hnhl} to true
- add "%name of player's tool%.|.%lore of player's tool%.|.%arg 3%.|.%type of player's tool%" to {@itemvar}
- if lore of player's tool is not set:
- set {_hnnl} to true
- add "%name of player's tool%.|.%arg 3%.|.%type of player's tool%" to {@itemvar}
- if {_hnnl} is true:
- send "{@pref2} Item Name: %{_c1}%%name of player's tool%"
- send "{@pref2} Now Can Be Sold On %{_c2}%%arg 2% %{_c3}%NPC"
- send "{@pref2} %{_c3}%With Price: %{_c4}%%arg 3%"
- if {_nnnl} is true:
- send "{@pref2} Item Name: %{_c1}%%type of player's tool%"
- send "{@pref2} Now Can Be Sold On %{_c2}%%arg 2% %{_c3}%NPC"
- send "{@pref2} %{_c3}%With Price: %{_c4}%%arg 3%"
- if {_nnhl} is true:
- set {_lore::*} to lore of player's tool split at "||"
- send "{@pref2} Item Name: %{_c1}%%type of player's tool%"
- loop size of {_lore::*} times:
- send "{@pref2} Lore Line %loop-num%: %{_lore::%loop-num%}%"
- send "{@pref2} Now Can Be Sold On %{_c2}%%arg 2% %{_c3}%NPC"
- send "{@pref2} %{_c3}%With Price: %{_c4}%%arg 3%"
- if {_hnhl} is true:
- set {_lore::*} to lore of player's tool split at "||"
- send "{@pref2} Item Name: %{_c1}%%name of player's tool%"
- loop size of {_lore::*} times:
- send "{@pref2} Lore Line %loop-num%: %{_lore::%loop-num%}%"
- send "{@pref2} Now Can Be Sold On %{_c2}%%arg 2% %{_c3}%NPC"
- send "{@pref2} %{_c3}%With Price: %{_c4}%%arg 3%"
- stop
- send "{@pref2} {@dsnpcnotfound}"
- stop
- on citizen right click:
- wait 1 tick
- if player is online:
- add "a" to {_list::*}
- add "b" to {_list::*}
- add "c" to {_list::*}
- add "6" to {_list::*}
- add "d" to {_list::*}
- add "f" to {_list::*}
- add "7" to {_list::*}
- add "e" to {_list::*}
- loop 5 times:
- set {_c%loop-num%} to "&%a random element out of {_list::*}%"
- set {_c%loop-num%} to colored {_c%loop-num%}
- loop {@npcvar}:
- set {_id} to event-number
- set {_a::*} to loop-value split at ".|."
- add 1 to {_numbers}
- if "%{_a::1}%" is "87":
- set {ds.npc::%{_numbers}%} to "89.|.%{_a::2}%.|.%{_a::3}%"
- set {ds.item.%{ds.npc::%{_numbers}%}%::*} to {ds.item.87.|.%{_a::2}%.|.%{_a::3}%::*}
- if "%{_a::1}%" is "88":
- set {ds.npc::%{_numbers}%} to "90.|.%{_a::2}%.|.%{_a::3}%"
- set {ds.item.%{ds.npc::%{_numbers}%}%::*} to {ds.item.88.|.%{_a::2}%.|.%{_a::3}%::*}
- if "%{_a::1}%" is "%{_id}%":
- if inventory name of player's current inventory is "%{_a::2}% : %colored {_a::3}%":
- stop
- open chest with 3 row named "%{_a::2}% : %colored {_a::3}%" to player
- wait 4 tick
- loop 27 times:
- set {_slots} to loop-num - 1
- if {_slots} is not 13 or 22:
- format slot {_slots} of player with red stained glass pane named " " to be unstealable
- loop 8 times:
- set {_slots} to loop-num
- if player is online:
- format slot {_slots} of player with black stained glass pane named " " to be unstealable
- format slot 0 of player with shiny arrow named "&e&lList Items &7-&8>" with lore "&eSellable item In This NPC" to be unstealable
- format slot 22 of player with lime wool named "&aClick For Confirm" with lore "&e>> &fFill The Slot Then Click THIS &e<<" to run [invoke "sell" from player]
- loop {ds.item.%loop-value%::*}:
- add 1 to {_slot}
- set {_aaa} to {ds.item.%loop-value-1%::%{_slot}%}
- set {_item::*} to {_aaa} split at ".|."
- if {_item::4} is set:
- set {_item::4} to {_item::4} parsed as item
- if {_item::2} is set:
- format slot {_slot} of player with {_item::4} named "%{_item::1}%" with lore "%{_c4}%Sell Price: %{_c5}%%{_item::3}%||||%{_item::2}%" to be unstealable
- if {_item::2} is not set:
- format slot {_slot} of player with {_item::4} named "%{_item::1}%" with lore "%{_c4}%Sell Price: %{_c5}%%{_item::3}%" to be unstealable
- if {_item::4} is not set:
- set {_item::1} to {_item::1} parsed as item
- if {_item::3} is set:
- format slot {_slot} of player with {_item::1} named "%{_item::1}%" with lore "%{_c4}%Sell Price: %{_c5}%%{_item::3}%" to be unstealable
- if {_item::2} is not set:
- format slot {_slot} of player with {_item::1} named "%{_item::1}%" with lore "%{_c4}%Sell Price: %{_c5}%%{_item::3}%" to be unstealable
- sub "sell":
- if parameter 1 is online:
- add "a" to {_list::*}
- add "b" to {_list::*}
- add "c" to {_list::*}
- add "6" to {_list::*}
- add "d" to {_list::*}
- add "f" to {_list::*}
- add "7" to {_list::*}
- add "e" to {_list::*}
- loop 5 times:
- set {_c%loop-num%} to "&%a random element out of {_list::*}%"
- set {_c%loop-num%} to colored {_c%loop-num%}
- if inventory name of parameter 1's current inventory contains " : ":
- set {_sell} to parameter 1's current inventory's slot 13
- if parameter 1's current inventory's slot 13 is air:
- send "{@pref2} Put Item In The Blank Space" to parameter 1
- stop
- set {_item1} to parameter 1's current inventory's slot 1
- set {_item2} to parameter 1's current inventory's slot 2
- set {_item3} to parameter 1's current inventory's slot 3
- set {_item4} to parameter 1's current inventory's slot 4
- set {_item5} to parameter 1's current inventory's slot 5
- set {_item6} to parameter 1's current inventory's slot 6
- set {_item7} to parameter 1's current inventory's slot 7
- set {_item8} to parameter 1's current inventory's slot 8
- loop 8 times:
- set {_typesell} to type of parameter 1's current inventory's slot 13
- set {_typeitem} to type of parameter 1's current inventory's slot loop-num
- if "%{_typeitem}%" is "%{_typesell}%":
- if name of {_sell} is not set:
- set {_name} to "%type of parameter 1's current inventory's slot 13%"
- if name of {_sell} is set:
- set {_name} to "%name of parameter 1's current inventory's slot 13%"
- set {_a} to {_name}
- if "%name of {_item%loop-num%}%" is "%{_name}%":
- set {_lores::*} to lore of {_item%loop-num%} split at "||"
- if {_lores::3} is set:
- set {_b::*} to lore of {_sell} split at "||"
- set {_size} to size of {_lores::*} - 2
- loop {_size} times:
- set {_banyak} to loop-num-2 + 2
- add "%{_lores::%{_banyak}%}%" to {_real::*}
- set {_sizes} to size of {_real::*}
- loop {_sizes} times:
- if "%{_real::%loop-num-2%}%" is not "%{_b::%loop-num-2%}%":
- send "{@pref2} You Cannot Sell This Item Here" to parameter 1
- stop
- set {_item} to "%{_sell}%"
- set {_amount::*} to {_item} split at " "
- set {_amount} to {_amount::1} parsed as number
- set {_lores::*} to lore of {_item%loop-num%} split at "||"
- set {_lore::*} to {_lores::1} split at " "
- set {_1} to "%uncolored {_lore::3}%"
- set {_2} to {_1} parsed as number
- if {_amount} is not set:
- set {_price} to {_2}
- send "{@pref2} &3You Sell &f%{_name}% &3With Price &6%{_price}%&a$" to parameter 1
- add {_price} to parameter 1's balance
- remove {_sell} from parameter 1's current inventory
- stop
- wait 2 tick
- set {_price} to {_2} * {_amount}
- add {_price} to parameter 1's balance
- send "{@pref2} &3You Sell &c%{_amount}% &f%{_name}% &3With Price &6%{_price}%&a$" to parameter 1
- remove {_sell} from parameter 1's current inventory
- stop
- send "{@pref2} You Cannot Sell This Item Here" to parameter 1
- stop
- on inventory close:
- if inventory name of player's current inventory contains " : ":
- set {_b} to player's current inventory's slot 13
- give player {_b}
- loop items in player's inventory:
- if name of loop-item is " ":
- remove loop-item from player
- if lore of loop-item contains "Sell Price":
- remove loop-item from player
- if name of loop-item contains "List Items":
- remove loop-item from player
- if name of loop-item contains "Confirm":
- remove loop-item from player
Advertisement
Add Comment
Please, Sign In to add comment