on script load: set {_default} to yaml value "PIN-Security.Load_DefaultConfig" from file "../../PIN-Security/config.yml" if "%{_default}%" != "false": set yaml value "PIN-Security.Load_DefaultConfig" from file "../../PIN-Security/config.yml" to false set yaml value "PIN-Security.Register_Protection" from file "../../PIN-Security/config.yml" to true set yaml value "PIN-Security.Empty_Slot_ID" from file "../../PIN-Security/config.yml" to "293:1" set yaml value "PIN-Security.GUI_DisplayName" from file "../../PIN-Security/config.yml" to "PIN Security" set yaml value "PIN-Security.PlayerGUI_DisplayName" from file "../../PIN-Security/config.yml" to "PIN Setting" set yaml value "PIN-Security.Message.Register_Sucess" from file "../../PIN-Security/config.yml" to "You have register sucess with @pass!" set yaml value "PIN-Security.Message.Register_Chest_Sucess" from file "../../PIN-Security/config.yml" to "You have register chest with @pass!" set yaml value "PIN-Security.Message.Register_Break_Sucess" from file "../../PIN-Security/config.yml" to "You have register break with @pass!" set yaml value "PIN-Security.Message.Register_Drop_Sucess" from file "../../PIN-Security/config.yml" to "You have register drop with @pass!" set yaml value "PIN-Security.Message.Register_Chat_Sucess" from file "../../PIN-Security/config.yml" to "You have register chat with @pass!" set yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" to "You have reset your pin code to @pass!" set yaml value "PIN-Security.Message.Login_Sucess" from file "../../PIN-Security/config.yml" to "You have login sucessfully!" set yaml value "PIN-Security.PlayerGUI.Register_Display_ID" from file "../../PIN-Security/config.yml" to "369" set yaml value "PIN-Security.PlayerGUI.Register_Display_Name" from file "../../PIN-Security/config.yml" to "REGISTER" set yaml value "PIN-Security.PlayerGUI.Use_Chest_Features" from file "../../PIN-Security/config.yml" to true set yaml value "PIN-Security.PlayerGUI.Chest_Display_ID" from file "../../PIN-Security/config.yml" to "54" set yaml value "PIN-Security.PlayerGUI.Chest_Display_Name" from file "../../PIN-Security/config.yml" to "CHEST" set yaml value "PIN-Security.PlayerGUI.Use_Break_Features" from file "../../PIN-Security/config.yml" to true set yaml value "PIN-Security.PlayerGUI.Break_Display_ID" from file "../../PIN-Security/config.yml" to "1" set yaml value "PIN-Security.PlayerGUI.Break_Display_Name" from file "../../PIN-Security/config.yml" to "Break" set yaml value "PIN-Security.PlayerGUI.Use_Chat_Features" from file "../../PIN-Security/config.yml" to true set yaml value "PIN-Security.PlayerGUI.Chat_Display_ID" from file "../../PIN-Security/config.yml" to "339" set yaml value "PIN-Security.PlayerGUI.Chat_Display_Name" from file "../../PIN-Security/config.yml" to "Chat" set yaml value "PIN-Security.PlayerGUI.Use_Drop_Features" from file "../../PIN-Security/config.yml" to true set yaml value "PIN-Security.PlayerGUI.Drop_Display_ID" from file "../../PIN-Security/config.yml" to "158" set yaml value "PIN-Security.PlayerGUI.Drop_Display_Name" from file "../../PIN-Security/config.yml" to "Drop" set yaml value "PIN-Security.Sound.PIN_Code_Click" from file "../../PIN-Security/config.yml" to "BLOCK_LADDER_PLACE" set yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" to "ENTITY_PLAYER_LEVELUP" set yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" to "ENTITY_WOLF_DEATH" stop on script unload: delete {chestwork::*} delete {registering::*} delete {breakwork::*} delete {chatwork::*} delete {dropwork::*} stop on disconnect: delete {chestwork::%player%} delete {breakwork::%player%} delete {registering::%player%} delete {chatwork::%player%} delete {dropwork::%player%} stop function openPINSecurityGUI(p: player, t: text): set {_guiname} to yaml value "PIN-Security.GUI_DisplayName" from file "../../PIN-Security/config.yml" open chest with 6 rows named "%colored {_guiname}%" to {_p} wait a tick set slot 12 of {_p}'s current inventory to black stained glass named "&f1" set slot 13 of {_p}'s current inventory to 2 of black stained glass named "&f2" set slot 14 of {_p}'s current inventory to 3 of black stained glass named "&f3" set slot 21 of {_p}'s current inventory to 4 of black stained glass named "&f4" set slot 22 of {_p}'s current inventory to 5 of black stained glass named "&f5" set slot 23 of {_p}'s current inventory to 6 of black stained glass named "&f6" set slot 30 of {_p}'s current inventory to 7 of black stained glass named "&f7" set slot 31 of {_p}'s current inventory to 8 of black stained glass named "&f8" set slot 32 of {_p}'s current inventory to 9 of black stained glass named "&f9" set slot 39 of {_p}'s current inventory to red stained glass named "&f%{_t}%: " set slot 40 of {_p}'s current inventory to 0 of black stained glass named "&f0" set slot 41 of {_p}'s current inventory to green stained glass named "&A&NENTER" set {_emptyslot} to yaml value "PIN-Security.Empty_Slot_ID" from file "../../PIN-Security/config.yml" loop 54 times: if slot loop-number - 1 of {_p}'s current inventory is 0 air: set slot loop-number - 1 of {_p}'s current inventory to unbreakable {_emptyslot} parsed as itemtype stop command /pinset: permission: pinset.player trigger: set {_guiname} to yaml value "PIN-Security.PlayerGUI_DisplayName" from file "../../PIN-Security/config.yml" open chest with 1 rows named "%colored {_guiname}%" to player # Register set {_registerpin} to yaml value "PIN-Security.PlayerGUI.Register_Display_ID" from file "../../PIN-Security/config.yml" set {_registername} to yaml value "PIN-Security.PlayerGUI.Register_Display_Name" from file "../../PIN-Security/config.yml" set slot 0 of player's current inventory to {_registerpin} parsed as itemtype named "%colored {_registername}%" # Chest set {_usechest} to yaml value "PIN-Security.PlayerGUI.Use_Chest_Features" from file "../../PIN-Security/config.yml" if {_usechest} == true: set {_chestpin} to yaml value "PIN-Security.PlayerGUI.Chest_Display_ID" from file "../../PIN-Security/config.yml" set {_chestname} to yaml value "PIN-Security.PlayerGUI.Chest_Display_Name" from file "../../PIN-Security/config.yml" set slot 2 of player's current inventory to {_chestpin} parsed as itemtype named "%colored {_chestname}%" # Break set {_usebreak} to yaml value "PIN-Security.PlayerGUI.Use_Break_Features" from file "../../PIN-Security/config.yml" if {_usebreak} == true: set {_breakpin} to yaml value "PIN-Security.PlayerGUI.Break_Display_ID" from file "../../PIN-Security/config.yml" set {_breakname} to yaml value "PIN-Security.PlayerGUI.Break_Display_Name" from file "../../PIN-Security/config.yml" set slot 4 of player's current inventory to {_breakpin} parsed as itemtype named "%colored {_breakname}%" # Chat set {_usechat} to yaml value "PIN-Security.PlayerGUI.Use_Chat_Features" from file "../../PIN-Security/config.yml" if {_usechat} == true: set {_chatpin} to yaml value "PIN-Security.PlayerGUI.Chat_Display_ID" from file "../../PIN-Security/config.yml" set {_chatame} to yaml value "PIN-Security.PlayerGUI.Chat_Display_Name" from file "../../PIN-Security/config.yml" set slot 6 of player's current inventory to {_chatpin} parsed as itemtype named "%colored {_chatame}%" # Drop set {_usedrop} to yaml value "PIN-Security.PlayerGUI.Use_Drop_Features" from file "../../PIN-Security/config.yml" if {_usedrop} == true: set {_droppin} to yaml value "PIN-Security.PlayerGUI.Drop_Display_ID" from file "../../PIN-Security/config.yml" set {_dropname} to yaml value "PIN-Security.PlayerGUI.Drop_Display_Name" from file "../../PIN-Security/config.yml" set slot 8 of player's current inventory to {_droppin} parsed as itemtype named "%colored {_dropname}%" stop on connect: wait a tick set {registering::%player%} to true openPINSecurityGUI(player, "REGISTER PIN") stop on break: set {_usebreak} to yaml value "PIN-Security.PlayerGUI.Use_Break_Features" from file "../../PIN-Security/config.yml" if {_usebreak} == true: if "%{breakwork::%player%}%" != "true": cancel event openPINSecurityGUI(player, "BREAK PIN") stop on rightclick on chest: set {_usechest} to yaml value "PIN-Security.PlayerGUI.Use_Chest_Features" from file "../../PIN-Security/config.yml" if {_usechest} == true: if "%{chestwork::%player%}%" != "true": cancel event openPINSecurityGUI(player, "CHEST PIN") stop on chat: set {_usechat} to yaml value "PIN-Security.PlayerGUI.Use_Chat_Features" from file "../../PIN-Security/config.yml" if {_usechat} == true: if "%{chatwork::%player%}%" != "true": cancel event openPINSecurityGUI(player, "CHAT PIN") stop on drop: set {_usedrop} to yaml value "PIN-Security.PlayerGUI.Use_Drop_Features" from file "../../PIN-Security/config.yml" if {_usedrop} == true: if "%{dropwork::%player%}%" != "true": cancel event openPINSecurityGUI(player, "DROP PIN") stop on inventory click: set {_pguiname} to yaml value "PIN-Security.PlayerGUI_DisplayName" from file "../../PIN-Security/config.yml" if inventory name of player's current inventory == "%colored {_pguiname}%": cancel event if clicked slot is 0: openPINSecurityGUI(player, "RESET REGISTER PIN") stop if clicked slot is 8: if {dropwork::%player%} == true: openPINSecurityGUI(player, "RESET DROP PIN") stop openPINSecurityGUI(player, "DROP PIN") stop if clicked slot is 6: if {chatwork::%player%} == true: openPINSecurityGUI(player, "RESET CHAT PIN") stop openPINSecurityGUI(player, "CHAT PIN") stop if clicked slot is 4: if {breakwork::%player%} == true: openPINSecurityGUI(player, "RESET BREAK PIN") stop openPINSecurityGUI(player, "BREAK PIN") stop if clicked slot is 2: if {chestwork::%player%} == true: openPINSecurityGUI(player, "RESET CHEST PIN") stop openPINSecurityGUI(player, "CHEST PIN") stop set {_guiname} to yaml value "PIN-Security.GUI_DisplayName" from file "../../PIN-Security/config.yml" if inventory name of player's current inventory == "%colored {_guiname}%": cancel event if clicked slot is 39: stop if clicked slot is not 41: set {_emptyslot} to yaml value "PIN-Security.Empty_Slot_ID" from file "../../PIN-Security/config.yml" if clicked item is not {_emptyslot} parsed as itemtype: set {_name} to "%uncolored slot 39 of player's current inventory's name%" set slot 39 of player's current inventory to slot 39 of player's current inventory named "%{_name}%%clicked item's name%" set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_Click" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop if clicked slot is 41: set {_pass} to "%uncolored slot 39 of player's current inventory's name%" if "%{_pass}%" contains "RESET CHEST": replace all "RESET CHEST PIN: " with "" in {_pass} set yaml value "%player%.PINCode.Chest" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop if "%{_pass}%" contains "RESET BREAK": replace all "RESET BREAK PIN: " with "" in {_pass} set yaml value "%player%.PINCode.Break" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop if "%{_pass}%" contains "RESET CHAT": replace all "RESET CHAT PIN: " with "" in {_pass} set yaml value "%player%.PINCode.Chat" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop if "%{_pass}%" contains "RESET DROP": replace all "RESET DROP PIN: " with "" in {_pass} set yaml value "%player%.PINCode.Drop" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop if "%{_pass}%" contains "RESET REGISTER": replace all "RESET REGISTER PIN: " with "" in {_pass} set yaml value "%player%.PINCode.Register" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Reset_Password" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop if "%{_pass}%" contains "DROP": set {_passp} to yaml value "%player%.PINCode.Drop" from file "../../PIN-Security/playerdata/%player's uuid%.yml" replace all "DROP PIN: " with "" in {_pass} if "%{_passp}%" == "": set yaml value "%player%.PINCode.Drop" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {dropwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Register_Drop_Sucess" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop IF "%{_pass}%" == "%{_passp}%": set {dropwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 close player's inventory stop close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop if "%{_pass}%" contains "CHAT": set {_passp} to yaml value "%player%.PINCode.Chat" from file "../../PIN-Security/playerdata/%player's uuid%.yml" replace all "CHAT PIN: " with "" in {_pass} if "%{_passp}%" == "": set yaml value "%player%.PINCode.Chat" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {chatwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Register_Chat_Sucess" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop IF "%{_pass}%" == "%{_passp}%": set {chatwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 close player's inventory stop close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop if "%{_pass}%" contains "BREAK": set {_passp} to yaml value "%player%.PINCode.Break" from file "../../PIN-Security/playerdata/%player's uuid%.yml" replace all "BREAK PIN: " with "" in {_pass} if "%{_passp}%" == "": set yaml value "%player%.PINCode.Break" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {breakwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Register_Break_Sucess" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop IF "%{_pass}%" == "%{_passp}%": set {breakwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 close player's inventory stop close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop if "%{_pass}%" contains "CHEST": set {_passp} to yaml value "%player%.PINCode.Chest" from file "../../PIN-Security/playerdata/%player's uuid%.yml" replace all "CHEST PIN: " with "" in {_pass} if "%{_passp}%" == "": set yaml value "%player%.PINCode.Chest" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory set {chestwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Register_Chest_Sucess" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop IF "%{_pass}%" == "%{_passp}%": set {chestwork::%player%} to true set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 close player's inventory stop close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop if "%{_pass}%" contains "REGISTER": set {_passp} to yaml value "%player%.PINCode.Register" from file "../../PIN-Security/playerdata/%player's uuid%.yml" replace all "REGISTER PIN: " with "" in {_pass} # REGISTERING if "%{_passp}%" == "": set yaml value "%player%.PINCode.Register" from file "../../PIN-Security/playerdata/%player's uuid%.yml" to "%{_pass}%" close player's inventory delete {registering::%player%} set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Register_Sucess" from file "../../PIN-Security/config.yml" replace all "@pass" with "%{_pass}%" in {_loginmsg} send "%{_loginmsg}%" to player stop # LOGIN SUCESS if "%{_passp}%" == "%{_pass}%": close player's inventory delete {registering::%player%} set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_True" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 set {_loginmsg} to yaml value "PIN-Security.Message.Login_Sucess" from file "../../PIN-Security/config.yml" send "%{_loginmsg}%" to player stop close player's inventory set {_sound} to yaml value "PIN-Security.Sound.PIN_Code_False" from file "../../PIN-Security/config.yml" play sound "%{_sound}%" at player with volume 1 and pitch 1 stop on inventory close: wait a tick if {registering::%player%} == true: openPINSecurityGUI(player, "REGISTER PIN") stop on damage: if yaml value "PIN-Security.Register_Protection" from file "../../PIN-Security/config.yml" == true: if {registering::%victim%} == true: cancel event stop