Code:
on load:
load yaml "plugins/SanalMarket/market.yml" as "market.yml"
load yaml "plugins/SanalMarket/ayarlar.yml" as "ayarlar.yml"
command /market:
trigger:
market(player)
function market(p: player):
open virtual chest with 6 row named "&b&lMarket" to {_p}
loop yaml node keys "listeler" of "market.yml":
set {_name} to yaml value "listeler.%loop-value%.name" from "market.yml"
set {_slot} to yaml value "listeler.%loop-value%.slot" from "market.yml" - 1
make gui slot {_slot} of {_p} with (loop-value parsed as material) named {_name} to run function iceri({_p}, loop-value, "%{_name}%")
function iceri(p: player, kategori: text, name: text):
open virtual chest with 6 row named "%{_name}%" to {_p}
loop yaml node keys "ayarlar.%{_kategori}%" of "ayarlar.yml":
set {_fiyat} to yaml value "ayarlar.%{_kategori}%.%loop-value%.fiyat" from "ayarlar.yml"
set {_slot} to yaml value "ayarlar.%{_kategori}%.%loop-value%.slot" from "ayarlar.yml"
make gui slot {_slot} - 1 of {_p} with (loop-value parsed as material) with lore "&a&lAlış &f&l» %{_fiyat}%" to run function onaymarket({_p}, loop-value, "%{_fiyat}%", "&a&lAlış &f&l» %{_fiyat}%")
make gui slot 53 of {_p} with barrier named "&cGeri git" to run function market({_p})
Code:
ayarlar:
chest:
sapling:
slot: 1
fiyat: 600
glass:
white stained glass pane:
slot: 1
fiyat: 250
black stained glass pane:
slot: 2
fiyat: 250
Code:
listeler:
chest:
slot: 3
name: '§3§lDekarasyon'
glass:
slot: 5
name: '§3§lRenkli Camlar'
(If there is a more optimized version of this skript, you can send it.)
Skript version: 2.4 alpha-4
Tuske version: 18.2-Pikachu-Patch-3
Server version: 1.14.3
[doublepost=1563825517,1563803854][/doublepost]Any one?