Merhabalar. Aşağıdaki skriptte 8,16,32 veya 64 adetli satış yapmaya çalıştığımda Adet satış ücreti yerine hepsinin satış ücretini vermekte ve sadece envanterden sattığım adet kadar eksilmektedir. Yardımcı olursanız sevinirim
Güncel.
Kod:
options:
p: &5&lSkyBlock &e»
demirfiyat: 250
altınfiyat: 150
elmasfiyat: 300
zümrütfiyat: 200
kaktüsfiyat: 50
demirblokfiyat: 450
altınblokfiyat: 350
elmasblokfiyat: 400
zümrütblokfiyat: 300
kızıltaşblokfiyat: 150
command /sat:
trigger:
open virtual chest with size 3 named "&c&nSat Menü" to player
wait a tick
make gui slot (numbers between 0 and 27) of player with gray stained glass pane
make gui slot 0 of player with iron ingot named "&fDemir" to run function esyaSatmenu(player, iron ingot, {@demirfiyat}, "&fDemir")
make gui slot 1 of player with gold ingot named "&6Altın" to run function esyaSatmenu(player, gold ingot, {@altınfiyat}, "&6Altın")
make gui slot 2 of player with diamond named "&bElmas" to run function esyaSatmenu(player, diamond, {@elmasfiyat}, "&bElmas")
make gui slot 3 of player with emerald named "&aZümrüt" to run function esyaSatmenu(player, emerald, {@zümrütfiyat}, "&aZümrüt")
make gui slot 4 of player with cactus named "&2Kaktüs" to run function esyaSatmenu(player, cactus, {@kaktüsfiyat}, "&2Kaktüs")
make gui slot 18 of player with iron block named "&fDemir Blok" to run function esyaSatmenu(player, iron block, {@demirblokfiyat}, "&fDemir Blok")
make gui slot 19 of player with gold block named "&6Altın Blok" to run function esyaSatmenu(player, gold block, {@altınblokfiyat}, "&6Altın Blok")
make gui slot 20 of player with diamond block named "&bElmas Blok" to run function esyaSatmenu(player, diamond block, {@elmasblokfiyat}, "&bElmas Blok")
make gui slot 21 of player with emerald block named "&aZümrüt Blok" to run function esyaSatmenu(player, emerald block, {@zümrütblokfiyat}, "&aZümrüt Blok")
make gui slot 22 of player with redstone block named "&4Kızıltaş Blok" to run function esyaSatmenu(player, redstone, {@kızıltaşblokfiyat}, "&4Kızıltaş Blok")
make gui slot 26 of player with redstone named "&cKapat" to close
function esyaSat(p: player, i: item, n: number, m: number, txt: text):
if amount of {_i} in {_p}'s inventory is greater than or equal to {_n}:
add (amount of {_i} in {_p}'s inventory * {_m}) to {_p}'s balance
send {_p} title "&a&lBaşarılı" with subtitle "&7Envanterindeki &r%{_n}% %{_txt}% &7satıldı!" for 2 second
set action bar of {_p} to "&4&l» &2Başarılı &4&l«"
remove {_n} of {_i} from {_p}'s inventory
else:
close {_p}'s inventory
send {_p} title "&4&lBaşarısız" with subtitle "&7Envanterinde yeterli eşya yok!" for 2 second
set action bar of {_p} to "&4&l» &cBaşarısız &4&l«"
function esyaSathepsi(p: player, i: item, m: number, txt: text):
if amount of {_i} in {_p}'s inventory is greater than 0:
add (amount of {_i} in {_p}'s inventory * {_m}) to {_p}'s balance
send {_p} title "&a&lBaşarılı" with subtitle "&7Envanterindeki &r%amount of {_i} in {_p}'s inventory% %{_txt}% &7satıldı!" for 2 second
set action bar of {_p} to "&4&l» &2Başarılı &4&l«"
remove all {_i} from {_p}'s inventory
close {_p}'s inventory
else:
close {_p}'s inventory
send {_p} title "&4&lBaşarısız" with subtitle "&7Envanterinde yeterli eşya yok!" for 2 second
set action bar of {_p} to "&4&l» &cBaşarısız &4&l«"
function esyaSatmenu(p: player, i: item, m: number, txt: text):
open virtual chest with size 3 named "&c&nSat Menü" to {_p}
wait a tick
make gui slot (numbers between 0 and 27) of {_p} with gray stained glass pane
make gui slot 4 of {_p} with skull of ("MHF_Question" parsed as an offline player) named "%{_txt}%" with lore "&7Envanterinde &c%amount of {_i} in {_p}'s inventory% &7tane bulunmakta.||&7%{_txt}% &7tanesi &a%{_m}%Tl" to nothing
make gui slot 9 of {_p} with {_i} named "&e&n8 tane sat" with lore "||&7Tıklayarak &c8 &7tane sat||||&7Alacağın para: &a%(8 * {_m})%" to run function esyaSat({_p}, {_i}, 8, {_m}, {_txt})
make gui slot 11 of {_p} with {_i} named "&e&n16 tane sat" with lore "||&7Tıklayarak &c16 &7tane sat||||&7Alacağın para: &a%(16 * {_m})%" to run function esyaSat({_p}, {_i}, 16, {_m}, {_txt})
make gui slot 13 of {_p} with {_i} named "&e&n32 tane sat" with lore "||&7Tıklayarak &c32 &7tane sat||||&7Alacağın para: &a%(32 * {_m})%" to run function esyaSat({_p}, {_i}, 32, {_m}, {_txt})
make gui slot 15 of {_p} with {_i} named "&e&n64 tane sat" with lore "||&7Tıklayarak &c64 &7tane sat||||&7Alacağın para: &a%(64 * {_m})%" to run function esyaSat({_p}, {_i}, 64, {_m}, {_txt})
make gui slot 17 of {_p} with {_i} named "&6&nHepsini sat" with lore "||&7Tıklayarak &chepsini &7sat||||&7Alacağın para: &a%(amount of {_i} in {_p}'s inventory * {_m})%" to run function esyaSathepsi({_p}, {_i}, {_m}, {_txt})
make gui slot 26 of {_p} with redstone named "&cGeri dön" to run {_p} command "sat"
Gönderi otomatik olarak birleştirildi:
Güncel.
Son düzenleme: