Merhaba Türkiye'nin sevgili Minecraft oyuncuları, bugün harika bir coin skripti ile karşınızdayım. Skriptimin adı fCoin.
Skript 1.8 için yapılmıştır. Eğer 1.8 kullanmayıp bu skripti kullanmak istiyorsanız bana discord adresimden ulaşın istediğiniz versiyonu yapıp atayım size.
Notlar:
- 1 obsidian kırmak 1 adet coin kazandırır.
- Markete maksimum 54 adet eşya koyabilirsiniz.
- Bütün oyuncuların coin bilgileri "plugins/fCoin/players.yml" içerisinde bulunur.
- Admin komutlarını kullanmak için "coin.admin" izni gerekmektedir.
Admin komutları:
- fcoin gönder [oyuncu] [miktar]
- fcoin yap [oyuncu] [miktar]
- fcoin eksilt [oyuncu] [miktar]
- fcoin öğren [oyuncu] [miktar]
Oyuncu komutları:
- coin
- coin gönder [oyuncu] [miktar]
- coin market
Skript 1.8 için yapılmıştır. Eğer 1.8 kullanmayıp bu skripti kullanmak istiyorsanız bana discord adresimden ulaşın istediğiniz versiyonu yapıp atayım size.
YAML:
items:
item1:
name: Elmas &2Kılıç
coin: 20
slot: 0
ditem: Diamond Sword
lore:
- "&8&m----------------------"
- " "
- "&7Büyüler;"
- "&8> &7Keskinlik: &210"
- "&8> &7Kırılmazlık: &210"
- " "
- "&8&m----------------------"
- " "
- "&7Ücret: &2%price%&7 Coin"
- " "
- "&8&m----------------------"
- " "
- "&8>&2&nSatın almak için tıkla"
- " "
item:
name: Kılıç
item: diamond sword
amount: 1
lore:
- "Bu skript Fhalinkz tarafından yapılmıştır"
- "Bu bir kılıçtır"
enchant:
- "sharpness 10"
- "unbreaking 10"
commands:
player:
- test1
console:
- test2
Kod:
on load:
load yaml "plugins/fCoin/players.yml" as "players"
load yaml "plugins/fCoin/market.yml" as "market"
if yaml "market" is empty:
set yaml value "items.item1.name" from "market" to "xD"
set yaml value "items.item1.coin" from "market" to "xD"
set yaml value "items.item1.slot" from "market" to 1
set yaml value "items.item1.ditem" from "market" to "xD"
add "&6Fiyatı: &a50 Coin" to yaml list "items.item1.lore" from "market"
add "bu bir kilic" to yaml list "items.item1.item.lore" from "market"
add "sharpness 5" to yaml list "items.item1.item.enchant" from "market"
add "unbreaking 5" to yaml list "items.item1.item.enchant" from "market"
add "test1" to yaml list "items.item1.item.commands.player" from "market"
add "test2" to yaml list "items.item1.item.commands.console" from "market"
save yaml "market"
loop yaml nodes with keys "items" from "market":
if yaml value "items.%loop-value%.coin" from "market" isn't set:
send "&8[&afCoin&8] &4Yaml Hatası! &c""plugins/fCoin/market.yml"" dosyasında hata bulundu. &6Coin&4'e değer verilmemiş." to console
on inventory close:
set {_n} to impGetCoin(player)
if {_n} is 0:
delete yaml value "players.%player%" from "players"
command /coin [<text>] [<player>] [<number>]:
trigger:
if arg-1 isn't set:
send "&6Coin Miktarın: &f%impGetCoin(player) otherwise 0%" to player
if arg-1 is "gönder" or "gonder":
if arg-2 is set:
if arg-3 is set:
if impGetCoin(player) is greater than or equal to arg-3:
impCoin(player, arg-3, "remove")
impCoin(arg-2, arg-3, "add")
send "&6%player% &7adlı oyuncu sana &6%arg-3% &7adet coin gönderdi." to arg-2
send "&6%arg-2% &7adlı oyuncuya &6%arg-3% &7adet coin gönderdin." to player
save yaml "players"
if arg-1 is "market":
impCoinMarket(player)
command /fcoin [<text>] [<offline player>] [<number>]:
permission: coin.admin
trigger:
if arg-1 isn't set:
send "&6/fcoin &fgonder [player] [sayı]"
send "&6/fcoin &fyap [player] [sayı]"
send "&6/fcoin &feksilt [player] [sayı]"
send "&6/fcoin &fogren [player]"
if arg-1 is "gonder" or "gönder":
impCoin(arg-2, arg-3, "add")
send "&6%arg-2% &7adlı oyuncuya &6%arg-3% &7adet coin gönderildi."
if arg-1 is "yap":
impCoin(arg-2, arg-3, "set")
send "&6%arg-2% &7adlı oyuncunun coini &6%arg-3% &7olarak ayarlandı."
if arg-1 is "eksilt":
impCoin(arg-2, arg-3, "remove")
send "&6%arg-2% &7adlı oyuncudan &6%arg-3% &7adet coin silindi."
if arg-1 is "ogren" or "öğren":
send "&6%arg-2% &7adlı oyuncunun coin miktarı &6%impGetCoin(arg-2) otherwise 0%."
function impCoin(p: player, n: number, a: text):
if {_a} is "add":
set {_v} to (yaml value "players.%{_p}%" from "players")
set (yaml value "players.%{_p}%" from "players") to {_n} + {_v}
if {_a} is "remove":
set {_v} to (yaml value "players.%{_p}%" from "players")
set (yaml value "players.%{_p}%" from "players") to {_v} - {_n}
if {_a} is "set":
set (yaml value "players.%{_p}%" from "players") to {_n}
save yaml "players"
function impGetCoin(p: player) :: number:
set {_coin} to (yaml value "players.%{_p}%" from "players") otherwise 0
return {_coin}
function impCoinMarket(player: player):
open virtual chest with size 6 named "&6Coin &8>> &aMarket" to {_player}
make gui slot (integers between 0 and 53) of {_player} with black stained glass pane named " " to nothing
loop yaml nodes with keys "items" from "market":
delete {_s::*}
set {_s::slot} to yaml value "items.%loop-value%.slot" from "market"
set {_s::ditem} to yaml value "items.%loop-value%.ditem" from "market" parsed as item type
set {_s::lore::*} to yaml list "items.%loop-value%.lore" from "market"
set {_s::name} to yaml value "items.%loop-value%.name" from "market"
set {_coin} to yaml value "items.%loop-value%.coin" from "market"
set {_item::name} to yaml value "items.%loop-value%.item.name" from "market"
set {_item::item} to yaml value "items.%loop-value%.item.item" from "market" parsed as item type
set {_item::lore::*} to yaml list "items.%loop-value%.item.lore" from "market"
set {_item::amount} to yaml value "items.%loop-value%.item.amount" from "market"
set {_item::enchant::*} to yaml list "items.%loop-value%.item.enchant" from "market"
loop {_item::enchant::*}:
set {_item::enchant::%loop-value-2%} to loop-value-2 parsed as enchantment type
set {_item::player-commands::*} to yaml list "items.%loop-value%.item.commands.player" from "market"
set {_item::console-commands::*} to yaml list "items.%loop-value%.item.commands.console" from "market"
replace "%%price%%" with "%{_coin}%" in {_s::lore::*}
replace "%%player%%" with "%{_player}%" in {_item::console-commands::*}
make gui slot {_s::slot} of {_player} with ({_s::ditem} named colored {_s::name} with lore colored join {_s::lore::*} with "||") to close:
if impGetCoin({_player}) is greater than or equal to {_coin}:
impCoin({_player}, {_coin}, "remove")
loop {_item::player-commands::*}:
execute player command {_item::player-commands::*}
stop loop
loop {_item::console-commands::*}:
execute console command {_item::console-commands::*}
stop loop
if {_item::enchant::*} is set:
set {_item-} to ({_item::item} named colored {_item::name} with lore colored join {_item::lore::*} with "||")
loop {_item::enchant::*}:
enchant {_item-} with {_item::enchant::%loop-value-2%}
give {_item::amount} of {_item-} to {_player}
else:
give {_item::amount} of ({_item::item} named colored {_item::name} with lore colored join {_item::lore::*} with "||") to {_player}
save yaml "players"
else:
send "&7Bu eşyayı almak için yeterli miktarda &6Coin&7'e sahip değilsin." to {_player}
on break:
if event-block is obsidian block:
impCoin(player, {_level}, "add")
Notlar:
- 1 obsidian kırmak 1 adet coin kazandırır.
- Markete maksimum 54 adet eşya koyabilirsiniz.
- Bütün oyuncuların coin bilgileri "plugins/fCoin/players.yml" içerisinde bulunur.
- Admin komutlarını kullanmak için "coin.admin" izni gerekmektedir.
Admin komutları:
- fcoin gönder [oyuncu] [miktar]
- fcoin yap [oyuncu] [miktar]
- fcoin eksilt [oyuncu] [miktar]
- fcoin öğren [oyuncu] [miktar]
Oyuncu komutları:
- coin
- coin gönder [oyuncu] [miktar]
- coin market