Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- set {slm.r1} to polished granite
- set {slm.r2} to polished andesite
- set {slm.r3} to polished diorite
- set {slm.r4} to netherite block
- set {slm.r5} to packed ice block
- set {slm.r6} to gold block
- set {slm1.sound} to "block.note_block.cow_bell"
- set {token.small.name} to gold nugget named "&7Small Casino Token"
- command /slot [<text>]:
- trigger:
- if player is not an op:
- stop
- if arg-1 is "reload":
- execute player command "/sk reload KK/SLM/SLM1"
- if arg-1 is "maker":
- give player 1 of paper named "&bSlot Maker"
- if arg-1 is "token":
- give player 64 of {token.small.name}
- on right click on sign:
- if player's tool is paper named "&bSlot Maker":
- if line 1 of target block contain "slm":
- set {_name} to line 1 of target block
- send line 1 of target block to player
- if line 2 of target block is "set":
- set {_type} to line 3 of target block
- set block at event-location to diamond block
- set {slm::%{_name}%::%{_type}%} to event-location
- send "%{slm::%{_name}%::%{_type}%}%" to player
- on region leave:
- set {_sections::*} to region at player
- set {_sections} to "%{_sections::*}%"
- set {_sections::*} to {_sections} split at " "
- loop {_sections::*}:
- if loop-value contain "slm":
- set {_temp} to loop-value
- if {_temp} contain "slm":
- set line 1 of block at {slm::%{_temp}%::sign} to ""
- clear {slm::%{_temp}%::player}
- set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : "
- clear {slm::%{_temp}%::bet}
- on right click on button:
- set {_warning.area} to "%{casino.prefix}% &7>> Sorry, You are not in the area of &eSlot 1"
- set {_warning.working} to "%{casino.prefix}% &7>> Sorry, The machine is currently working."
- set {_warning.no.token} to "%{casino.prefix}% &7>> You don't have enough token to play this machine."
- set {_warning.register} to "%{casino.prefix}% &7>> You are registered to"
- set {_warning.warning} to "%{casino.prefix}% &7>> &cWarning!: &7Don't left the slot area until it finished. Otherwise, You will get &cnothing &7from the machine."
- set {_warning.register.name} to "%{casino.prefix}% &7>> This machine is registered to &c%{slm1.player}%"
- set {_sections::*} to region at player
- set {_sections} to "%{_sections::*}%"
- set {_sections::*} to {_sections} split at " "
- loop {_sections::*}:
- if loop-value contain "slm":
- set {_temp} to loop-value
- if {slm::%{_temp}%::player} is not set:
- set {slm::%{_temp}%::player} to player
- set line 1 of block at {slm::%{_temp}%::sign} to "&4%name of player%"
- send "%{_warning.register}% %{_temp}%" to player
- set {slm::%{_temp}%::bet} to 2
- set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : 2"
- if {slm::%{_temp}%::player} is player:
- cancel event
- if location of target block is {slm::%{_temp}%::button1}:
- if {slm::%{_temp}%::active} is 1:
- stop
- if {slm::%{_temp}%::bet} > 2:
- set {slm::%{_temp}%::bet} to {slm::%{_temp}%::bet} - 1
- set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : %{slm::%{_temp}%::bet}%"
- if location of target block is {slm::%{_temp}%::button3}:
- if {slm::%{_temp}%::active} is 1:
- stop
- if {slm::%{_temp}%::bet} < 10:
- set {slm::%{_temp}%::bet} to {slm::%{_temp}%::bet} + 1
- set line 2 of block at {slm::%{_temp}%::sign} to "&1Bet : %{slm::%{_temp}%::bet}%"
- if location of target block is {slm::%{_temp}%::button2}:
- if amount of {token.small.name} in player's inventory is less than {slm::%{_temp}%::bet}:
- send {_warning.no.token} to player
- stop
- if {slm::%{_temp}%::active} is 1:
- stop
- remove {slm::%{_temp}%::bet} of {token.small.name} from player
- set {_min} to 2
- set {_max} to 6
- set {_loop1} to a random integer between 15 and 25
- set {_loop2} to a random integer between 10 and 15
- set {_loop3} to a random integer between 10 and 15
- set {slm::%{_temp}%::active} to 1
- loop {_loop1} times:
- wait 0.1 second
- set {_random1} to a random integer between {_min} and {_max}
- set {_random2} to a random integer between {_min} and {_max}
- set {_random3} to a random integer between {_min} and {_max}
- set block at {slm::%{_temp}%::b1} to {slm.r%{_random1}%}
- set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
- set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
- play sound {slm1.sound} with volume 0.2 and pitch 1 at {slm::%{_temp}%::sign}
- loop {_loop2} times:
- wait 0.1 second
- set {_random2} to a random integer between {_min} and {_max}
- set {_random3} to a random integer between {_min} and {_max}
- set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
- set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
- if {_random1} = {_random2}:
- chance of 1%:
- set {_random2} to a random integer between {_min} and {_max}
- set block at {slm::%{_temp}%::b2} to {slm.r%{_random2}%}
- play sound {slm1.sound} with volume 0.2 and pitch 1.1 at {slm::%{_temp}%::sign}
- loop {_loop3} times:
- wait 0.2 second
- set {_random3} to a random integer between {_min} and {_max}
- set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
- if {_random2} = {_random3}:
- chance of 1%:
- set {_random3} to a random integer between {_min} and {_max}
- set block at {slm::%{_temp}%::b3} to {slm.r%{_random3}%}
- play sound {slm1.sound} with volume 0.2 and pitch 1.2 at {slm::%{_temp}%::sign}
- play sound {slm1.sound} with volume 1 and pitch 1.3 at {slm::%{_temp}%::sign}
- set {slm::%{_temp}%::active} to 0
- if {_random1} = {_random2}:
- if {_random2} = {_random3}:
- if {_random1} = 1:
- set {_reward} to 4
- if {_random1} = 2:
- set {_reward} to 8
- if {_random1} = 3:
- set {_reward} to 16
- if {_random1} = 4:
- set {_reward} to 32
- if {_random1} = 5:
- set {_reward} to 64
- broadcast "%{casino.prefix}% &7>> &e%player% &7has won a jackpot &ax%{_reward}%"
- set line 3 of block at {slm::%{_temp}%::sign} to "Raward : &4x%{_reward}%"
- else if {_random1} = {_random2}:
- if {_random2} != {_random3}:
- set {_reward} to 0.5
- else if {_random2} = {_random3}:
- if {_random1} != {_random2}:
- set {_reward} to 0.5
- else:
- set {_reward} to 0
- set {_total} to {slm::%{_temp}%::bet}*{_reward}
- give player {_total} of {token.small.name}
- if block at {slm::%{_temp}%::b1} is {slm.r7}:
- give player {slm::%{_temp}%::bet}/2 of gold block
- if block at {slm::%{_temp}%::b2} is {slm.r7}:
- give player {slm::%{_temp}%::bet}/2 of gold block
- if block at {slm::%{_temp}%::b3} is {slm.r7}:
- give player {slm::%{_temp}%::bet}/2 of gold block
- else:
- stop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement