Just so you know, we don't know the file format for every file. If it's just a bunch of random characters, it's probably a .zip or .jar.
#if you wanna share the code give credits please (ApQd)
#Discord two#9009
function addnumber(p: player):
loop 16 times:
set {_num} to random integer between 1 and 16
if {2048slot.%{_num}%.%uuid of {_p}%} is not set:
set {2048slot.%{_num}%.%uuid of {_p}%} to 2
gui2048({_p})
stop
function gui2048(p: player):
set {_gui} to a new chest inventory with 6 row with name "&l2048"
set slots (all integers between 0 and 53) of {_gui} to gray glass pane named "&a"
set slot 25 of {_gui} to Lever named "&a&l&oControl" with lore "" and "&a&lHOW TO USE?" and "&6Make sure your mouse stay at this slot" and "&6and use the numbers (1, 2, 3 and 3) from" and "&6your keyboard to move the slots:" and "" and "&7Click at one to go Left" and "&7Click at two to go Down" and "&7Click at three to go Right" and "&7Click at four to go Up"
set slot 53 of {_gui} to Barrier named "&cRESET"
set slots (all integers between 10 and 13) of {_gui} to air
set slots (all integers between 19 and 22) of {_gui} to air
set slots (all integers between 28 and 31) of {_gui} to air
set slots (all integers between 37 and 40) of {_gui} to air
set {_loop} to 1
set {_slot} to 10
loop 4 time:
loop 4 time:
if {2048slot.%{_loop}%.%uuid of {_p}%} is set:
set slot {_slot} of {_gui} to bedrock named "&2No." with lore "&aGo touch some grass."
if {2048slot.%{_loop}%.%uuid of {_p}%} is 2:
set slot {_slot} of {_gui} to white wool named "&22"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 4:
set slot {_slot} of {_gui} to gray wool named "&24"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 8:
set slot {_slot} of {_gui} to yellow wool named "&28"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 16:
set slot {_slot} of {_gui} to orange wool named "&216"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 32:
set slot {_slot} of {_gui} to red wool named "&232"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 64:
set slot {_slot} of {_gui} to blue wool named "&264"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 128:
set slot {_slot} of {_gui} to lime wool named "&2128"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 256:
set slot {_slot} of {_gui} to green wool named "&2256"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 512:
set slot {_slot} of {_gui} to pink wool named "&2512"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 1024:
set slot {_slot} of {_gui} to purple wool named "&21024"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 2048:
set slot {_slot} of {_gui} to black wool named "&22048"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 4096:
set slot {_slot} of {_gui} to brown wool named "&24096"
if {2048slot.%{_loop}%.%uuid of {_p}%} is 8192:
set slot {_slot} of {_gui} to cyan wool named "&28192"
add 1 to {_loop}
add 1 to {_slot}
add 5 to {_slot}
open {_gui} to {_p}
wait 3 tick
set slot 0 of {_p}'s inventory to arrow named "&eLeft"
set slot 1 of {_p}'s inventory to arrow named "&eDown"
set slot 2 of {_p}'s inventory to arrow named "&eRight"
set slot 3 of {_p}'s inventory to arrow named "&eUp"
command /2048 [<text>]:
trigger:
loop 41 times:
set {inventory::%player's uuid%::slot::%loop-value%} to slot (loop-value - 1) of player
clear player's inventory
set {currentmode::%player's uuid%} to true
set {_loop} to 1
loop 16 time:
delete {2048slot.%{_loop}%.%player's uuid%}
add 1 to {_loop}
set {_num} to random integer between 1 and 16
set {2048slot.%{_num}%.%player's uuid%} to 2
set {_num} to random integer between 1 and 16
set {2048slot.%{_num}%.%player's uuid%} to 2
chance of 70%:
delete {2048slot.%{_num}%.%player's uuid%}
chance of 50%:
set {2048slot.%{_num}%.%player's uuid%} to 4
gui2048(player)
on inventory click:
name of event-inventory is "&l2048":
clicked slot is 53:
set {_loop} to 1
loop 16 time:
delete {2048slot.%{_loop}%.%player's uuid%}
add 1 to {_loop}
set {_num} to random integer between 1 and 16
set {2048slot.%{_num}%.%player's uuid%} to 2
set {_num} to random integer between 1 and 16
set {2048slot.%{_num}%.%player's uuid%} to 2
chance of 70%:
delete {2048slot.%{_num}%.%player's uuid%}
chance of 50%:
set {2048slot.%{_num}%.%player's uuid%} to 4
gui2048(player)
stop
clicked slot is 25:
if "%click type%" contains "LEFT" or "RIGHT":
cancel event
if "%click type%" contains "number key":
wait 1 tick
if slot 25 of current inventory of player is arrow named "&eLeft":
loop 3 times:
set {_loop} to 0
loop 16 times:
add 1 to {_loop}
if {2048slot.%{_loop}%.%player's uuid%} is set:
if {_loop} is not 1 or 5 or 9 or 13:
loop 3 times:
if {2048slot.%{_loop}-1%.%player's uuid%} is not set:
set {2048slot.%{_loop}-1%.%player's uuid%} to {2048slot.%{_loop}%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if {2048slot.%{_loop}-1%.%player's uuid%} is set:
if {2048slot.%{_loop}-1%.%player's uuid%} is equal to {2048slot.%{_loop}%.%player's uuid%}:
add {2048slot.%{_loop}%.%player's uuid%} to {2048slot.%{_loop}-1%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if slot 25 of current inventory of player is arrow named "&eUp":
loop 3 times:
set {_loop} to 0
loop 16 times:
add 1 to {_loop}
if {2048slot.%{_loop}%.%player's uuid%} is set:
if {_loop} is not 1 or 2 or 3 or 4:
loop 3 times:
if {2048slot.%{_loop}-4%.%player's uuid%} is not set:
set {2048slot.%{_loop}-4%.%player's uuid%} to {2048slot.%{_loop}%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if {2048slot.%{_loop}-4%.%player's uuid%} is set:
if {2048slot.%{_loop}-4%.%player's uuid%} is equal to {2048slot.%{_loop}%.%player's uuid%}:
add {2048slot.%{_loop}%.%player's uuid%} to {2048slot.%{_loop}-4%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if slot 25 of current inventory of player is arrow named "&eDown":
loop 3 times:
set {_loop} to 0
loop 16 times:
add 1 to {_loop}
if {2048slot.%{_loop}%.%player's uuid%} is set:
if {_loop} is not 13 or 14 or 15 or 16:
loop 3 times:
if {2048slot.%{_loop}+4%.%player's uuid%} is not set:
set {2048slot.%{_loop}+4%.%player's uuid%} to {2048slot.%{_loop}%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if {2048slot.%{_loop}+4%.%player's uuid%} is set:
if {2048slot.%{_loop}+4%.%player's uuid%} is equal to {2048slot.%{_loop}%.%player's uuid%}:
add {2048slot.%{_loop}%.%player's uuid%} to {2048slot.%{_loop}+4%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if slot 25 of current inventory of player is arrow named "&eRight":
loop 3 times:
set {_loop} to 0
loop 16 times:
add 1 to {_loop}
if {2048slot.%{_loop}%.%player's uuid%} is set:
if {_loop} is not 4 or 8 or 12 or 16:
loop 3 times:
if {2048slot.%{_loop}+1%.%player's uuid%} is not set:
set {2048slot.%{_loop}+1%.%player's uuid%} to {2048slot.%{_loop}%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if {2048slot.%{_loop}+1%.%player's uuid%} is set:
if {2048slot.%{_loop}+1%.%player's uuid%} is equal to {2048slot.%{_loop}%.%player's uuid%}:
add {2048slot.%{_loop}%.%player's uuid%} to {2048slot.%{_loop}+1%.%player's uuid%}
delete {2048slot.%{_loop}%.%player's uuid%}
set {_move} to true
wait 1 tick
gui2048(player)
if {_move} is true:
addnumber(player)
stop
gui2048(player)
stop
On Inventory Close:
name of event-inventory is "&l2048":
wait 4 tick
if name of current inventory of player is not "&l2048":
loop 41 times:
delete {currentmode::%player's uuid%}
set slot (loop-value - 1) of player to {inventory::%player's uuid%::slot::%loop-value%}
on join:
if {currentmode::%player's uuid%} is true:
loop 41 times:
delete {currentmode::%player's uuid%}
set slot (loop-value - 1) of player to {inventory::%player's uuid%::slot::%loop-value%}