Blade12
Birisi mi Spawnlandı?
Kod:
options:
# Hedef itemler ve komut şablonları
targetItem1: "#04a4fbDomuz Spawner"
targetItem1Command: "smartspawner give spawner %player% pig %amount%"
targetItem2: "Zombi Spawner"
targetItem2Command: "give %player% zombie_spawner %amount%"
on chat:
# Örnek mesaj: "&aBaşarıyla 1 adet #04a4fbDomuz Spawner &aaldın."
if message contains "adet":
set {_p} to player
set {_msg} to message
# ── Satın alınan miktarı al (örn: "2 adet")
set {_amount} to 1
if {_msg} matches ".*\\d+ adet.*":
set {_num::*} to {_msg} split at " adet"
set {_amount} to {_num::1} parsed as number
# ── Item 1 kontrol ──
if {_msg} contains {@targetItem1}:
# Konsol komutu oluştur
set {_cmd} to {@targetItem1Command}
replace "%player%" in {_cmd} with name of {_p}
replace "%amount%" in {_cmd} with {_amount}
execute console command {_cmd}
stop
# ── Item 2 kontrol ──
if {_msg} contains {@targetItem2}:
set {_cmd} to {@targetItem2Command}
replace "%player%" in {_cmd} with name of {_p}
replace "%amount%" in {_cmd} with {_amount}
execute console command {_cmd}
send "&aBaşarıyla %{_amount}% adet a4fb%{_material}% &aaldın." to {_p} replace {_material} with {@targetItem2}
stop