black_market_setup: type: task script: - define rare_items li@ - superbwarfare:ak_47_blueprint|10000 - superbwarfare:m_4_blueprint|10000 - superbwarfare:glock_18_blueprint|10000 - superbwarfare:ak_12_blueprint|10000 - superbwarfare:sks_blueprint|10000 - superbwarfare:hk_416_blueprint|10000 - superbwarfare:qbz_95_blueprint|10000 - superbwarfare:k_98_blueprint|10000 - superbwarfare:mosin_nagant_blueprint|10000 - superbwarfare:m_870_blueprint|10000 - superbwarfare:m_79_blueprint|10000 - superbwarfare:rpg_blueprint|10000 - define epic_items li@ - superbwarfare:vector_blueprint|50000 - superbwarfare:trachelium_blueprint|50000 - superbwarfare:insidious_blueprint|50000 - superbwarfare:mk_14_blueprint|50000 - superbwarfare:svd_blueprint|50000 - superbwarfare:m_98b_blueprint|50000 - superbwarfare:hunting_rifle_blueprint|50000 - superbwarfare:devotion_blueprint|50000 - superbwarfare:rpk_blueprint|50000 - superbwarfare:m_60_blueprint|50000 - superbwarfare:bocek_blueprint|50000 - define legendary_items li@ - superbwarfare:sentinel_blueprint|100000 - superbwarfare:ntw_20_blueprint|100000 - superbwarfare:aa_12_blueprint|100000 - superbwarfare:minigun_blueprint|100000 - superbwarfare:secondary_cataclysm_blueprint|100000 - superbwarfare:javelin_blueprint|100000 - define container_items li@ - superbwarfare:mk_42_blueprint|200000 - superbwarfare:mle_1934_blueprint|250000 - superbwarfare:hpj_11_blueprint|250000 # Get random, unique rare items - define shuffled_rare ]> - define today_rare1 <[shuffled_rare].get[1]> - define today_rare2 <[shuffled_rare].get[2]> # Pick others randomly - define today_epic ]> - define today_legendary ]> - define today_container ]> # Save flags: split into name and price - foreach li@rare1|rare2|epic|legendary|container: - define raw "<[today_<[value]>]>" - define name "<[raw].before[|]>" - define price "<[raw].after[|]>" - flag server "blackmarket_<[value]>_name:<[name]>" - flag server "blackmarket_<[value]>_price:<[price]>" # Update hologram on ZNPC (replace with your actual NPC ID) - define npc_id 123 - execute as_server "znpcs hologram set <[npc_id]> \"&4» &lBLACK MARKET &r&4«\"" - execute as_server "znpcs hologram add ]> \"&7Rare: &f &8- &a$\"" - execute as_server "znpcs hologram add ]> \"&7Rare: &f &8- &a$\"" - execute as_server "znpcs hologram add ]> \"&5Epic: &d &8- &a$\"" - execute as_server "znpcs hologram add ]> \"&6Legendary: &e &8- &a$\"" - execute as_server "znpcs hologram add ]> \"&2Container: &a &8- &a$\"" black_market_assignment: type: assignment actions: on click: - inventory open d:gui_black_market_menu gui_black_market_menu: type: inventory title: "&4&lBlack Market" size: 27 slots: 11: display: i@[display_name=&fRare Item 1,lore=&7Price: $] actions: - run black_market_purchase "rare1" 12: display: i@[display_name=&fRare Item 2,lore=&7Price: $] actions: - run black_market_purchase "rare2" 13: display: i@[display_name=&dEpic Item,lore=&7Price: $] actions: - run black_market_purchase "epic" 14: display: i@[display_name=&eLegendary Item,lore=&7Price: $] actions: - run black_market_purchase "legendary" 15: display: i@[display_name=&aContainer Item,lore=&7Price: $] actions: - run black_market_purchase "container" black_market_purchase: type: procedure definitions: type script: - define name _name]> - define price _price].as_decimal> - if >= <[price]>: - money take qty:<[price]> - give i@<[name]> to: - narrate "You bought <[name]> for $<[price]>!" - playeffect at: effect:VILLAGER_HAPPY - else: - narrate "You need $<[price]> to buy this item." - playeffect at: effect:SMOKE_NORMAL # Keep your existing black_market_setup task script here. # Also add the optional scheduler: black_market_scheduler: type: world events: on server start: - run black_market_setup - schedule every 1d run black_market_setup