Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ###Code###
- function pricing(blocktype: material, player: player, amount: number) :: objects:
- wait 2 ticks
- #message "Fabricator - DBG : Testing Pricing Function" to console
- if {_blocktype} contains bedrock or barrier or netherite block or ancient debris or crying obsidian or obsidian or command block or structure block or piston head or end portal frame or end portal or end gateway or nether portal:
- message "{@prefix}: ERROR - Invalid Block : ""%{_blocktype}%""" to {_player}
- set {TruFal.%{_player}%} to true
- set {total.%{_player}%} to 100000000000000000000000
- stop
- else:
- set {_price} to yaml value "prices.%{_blocktype}%" from file "plugins/Skript/scripts/Fabricator/FabricatorPrices.yml"
- wait 2 ticks
- if {_blocktype} is not air:
- wait 2 ticks
- if {_price} is number:
- message "{@prefix}:&r Price of %{_blocktype}% is set to %{_price}%" to {_player}
- if {_player}'s money >= ({_price} * {_amount}):
- wait 2 ticks
- set {_price} to {_price} * {_amount}
- message "{@prefix}:&r Charging %{_player}% - %{_price}% Credits for (%{_amount}% x ""%{_blocktype}%"")." to {_player}
- add {_price} to {total.%{_player}%}
- wait 1 tick
- set {TruFal.%{_player}%} to true
- else:
- message "{@prefix}:&r Insufficient Balance %{_player}% - %{_price}% Credits" to {_player}
- set {TruFal.%{_player}%} to false
- else:
- wait 2 ticks
- set {_price} to 75
- message "{@prefix}:&r Price of ""%{_blocktype}%"" is Unknown..." to {_player}
- message "{@prefix}:&r Defaulting to %{_price}%" to {_player}
- if {_player}'s money >= ({_price} * {_amount}):
- set {_price} to {_price} * {_amount}
- message "{@prefix}:&r Charging %{_player}% - %{_price}% Credits for (%{_amount}% x ""%{_blocktype}%"")." to {_player}
- add {_price} to {total.%{_player}%}
- wait 1 tick
- set {TruFal.%{_player}%} to true
- else:
- message "{@prefix}:&r &cInsufficient Balance&r %{_player}% - %{_price}% Credits" to {_player}
- set {TruFal.%{_player}%} to false
- else:
- wait 2 ticks
- set {_price} to 0
- message "{@prefix}:&r Price of ""%{_blocktype}%"" is %{_price}%..." to {_player}
- if {_player}'s money >= ({_price} * {_amount}):
- set {_price} to {_price} * {_amount}
- message "{@prefix}:&r Charging %{_player}% - %{_price}% Credits for (%{_amount}% x ""%{_blocktype}%"")." to {_player}
- add {_price} to {total.%{_player}%}
- wait 1 tick
- set {TruFal.%{_player}%} to true
- else:
- message "{@prefix}:&r &cInsufficient Balance&r %{_player}% - %{_price}% Credits" to {_player}
- set {TruFal.%{_player}%} to false
Advertisement
Add Comment
Please, Sign In to add comment