Jump to content

Sorbon

Member
  • Posts

    21
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Sorbon

  1. Huhu, I updated the ColorUtils; https://forums.skunity.com/threads/colorutils-1-16.12134/ Has a new feature btw, the command in your example is intended one too much.
  2. i added some comments in the code which shows in the post not in the file yet, but I will do that and fix the List error (I had disabled them xD) when i find the time, thanks for saying
  3. Good morning/evening For the people who use this Skript, pls use the new version now It contains some fixes for the 1.16 and also doesnt need TuSke anymore skReport.sk
  4. This skript is mainly for the Skript-Devs on Minehut It gives you some function to edit Lores and get/add level to a pickaxe or other items! It doesnt come with max values or premade Enchants, it just adds them and you can get the level for it note: This Skript works with and without SkQuery, so you don't have to worry about that function addLore(i:item,e:string): set {_lores::*} to getLores({_i}) add colored {_e} to {_lores::*} set {_i} to {_i} with lore {_lores::*} function getLores(i:item) :: strings: set {_lores::*} to lore of {_i} if {_lores::1} contains "||": set {_lores::*} to {_lores::1} split at "||" return {_lores::*} function getLine(i:item,e:string) :: integer: set {_lores::*} to getLores({_i}) loop {_lores::*}: if loop-value starts with colored {_e}: return loop-index parsed as integer return 0 function getLore(i:item,e:string) :: string: return line getLine({_i},{_e}) of lore of {_i} function setLore(i:item,n:integer,e:string): set line {_n} of lore of {_i} to colored {_e} function updateLore(i:item,e:string,f:string): set {_n} to getLine({_i},{_e}) setLore({_i},{_n},{_f}) function addLevel(i:item,e:string,n:integer): set {_y} to getLine({_i},{_e}) if {_y} = 0: addLore({_i},{_e}) set {_y} to getLine({_i},{_e}) set {_lore::*} to getLore({_i},{_e}) split at " " set {_f} to colored "%{_lore::1}% %getLevel({_i},{_e})+ {_n}%" setLore({_i},{_y},{_f}) function getLevel(i:item,e:string) :: integer: set {_lore::*} to getLore({_i},{_e}) split at " " return {_lore::2} parsed as integer command enchant <string> <integer>: trigger: addLevel(player's tool,arg-1,arg-2) #example /enchant &cExplosive&7 1 #Color codes are needed, if you want it simpler, you could create a list variable with the colored name as value and the alias as index; # set {enchant::explosive} to &cExplosive&7 # addLevel(player's tool,{enchant::%arg-1%},arg-2) So you get the right one on break: #To test for the Level, you can follow this example: if getLevel(player's tool,"&cExplosive&7") > 0: send "you have Explosive enchanted, Bumm"
  5. Thank you very much for your comment "%all offline players%" has been replaced with another way; set {_hasPlayed} to 1 if arg-1 has played before set {_hasPlayed} to 1 if arg-1 is online if {_hasPlayed} is set:
  6. options: # How to add ranks: # "Rank || Rank Prefix" that means, if you want to add the rank "Owner" with the prefix "&4Owner", you have to add "Owner||&4Owner" to the list below, be sure the last comma is an "and" ranks: "Default||&7Player&7","VIP||&a[VIP]&7","Supporter||Sup","Moderator||Mod","Admin||Admin" and "Owner||Owner" function getRank(n:string) :: string: set {_m::*} to {@ranks} loop {_m::*}: set {_s::*} to loop-value split at "||" return {_s::1} if {_s::1} is {_n} return "" function getPrefix(n:string) :: string: set {_m::*} to {@ranks} loop {_m::*}: set {_s::*} to loop-value split at "||" return {_s::2} if {_s::1} is {_n} function setRank(p:player,t:offlineplayer,n:string): set {_u} to uuid of {_t} set {_rank} to {rank::%{_u}%} if getRank({_n}) is "": send "This Rank does not exist" to {_p} else: if {_t} is online: set {rank::%{_u}%} to {_n} send "&7You've set &a%{_t}%&7's &7rank to %getPrefix({_n})%" to {_p} else: if {_t} has played before: set {rank::%{_u}%} to {_n} send "&7You've set &a%{_t}%&7's &7rank to %getPrefix({_n})%" to {_p} else: send "This player does not exist" to {_p} on join: setRank(player,player,"default") if {rank::%player's uuid%} is not set on chat: set chat format to "%getPrefix({rank::%player's uuid%})% %player%: &7%message%" command /setrank [<offlineplayer>] [<text>]: permission: skript.setrank permission message: &cYou may not use that command! trigger: if arg-2 is set: setRank(player,arg-1,arg-2) else: send "&7Usage: /setrank Player Rank" command /ranklist: permission: skript.ranklist permission message: &cYou may not use that command! usage: /ranklist trigger: send "" send "&3Rank List" send "" set {_n::*} to {@ranks} loop {_n::*}: set {_s::*} to loop-value split by "||" send "%{_s::2}% &8- &7""%{_s::1}%""" send ""
  7. Small Skript by Sorbon Usuage: You add the amount + base item in @BlocksToCompress and the upgraded version in @UpgradedVersion, it will it will always upgrade with the item, in the same position! options: # Just add them in order, and be carefully that you dont mess up :D # in this example: 64 coal = 2 coal blocks || 64 Iron ingot = 1 Iron block.... # seperated by "," and the last comma has to be "and" # it will always upgrade with the item at the same position! BlocksToCompress: 64 coal, 64 iron ingot and 64 diamond # Enchanted Items: 1 of glowing %item% # named item: 1 of %item% named "Name" # lore: 1 of %item% named "name" with lore "Lore 1", "Lore 2" and "lore 3" UpgradedVersion: 2 coal block named "lol", 1 of glowing iron block and 1 of stone named "name" with lore "Lore 1", "Lore 2" and "lore 3" command /compress: trigger: compress(player) command /decompress: trigger: decompress(player) function compress(p:player): set {_n::*} to {@BlocksToCompress} set {_m::*} to {@UpgradedVersion} loop {_n::*}: while {_p} has loop-value: remove loop-value from {_p}'s inventory give {_p} {_m::%loop-index%} set {_s} to true send "&bYou have no blocks to compress." to {_p} if {_s} is not set function decompress(p:player): set {_n::*} to {@BlocksToCompress} set {_m::*} to {@UpgradedVersion} loop {_m::*}: while {_p} has loop-value: if {_p} can hold {_n::%loop-index%}: remove loop-value from {_p}'s inventory give {_p} {_n::%loop-index%} send "&bYou have no blocks to decompress." to {_p} if {_s} is not set
  8. Please let me know if you want me to add anything ;D
  9. You can overwrite your own Report..... and ah User can only have one report, which can be overwritten...... That's way I created one today, be sure to check it out... You can create multiple Reports for each user which gets listed nicely..... Swayl, sry for editing your code
  10. Sorbon's Report Skript Update; No Tuske 1.16 fixes Plugins needed: Skript Features: Reports are sorted by Date Reports can be seen in a GUI You can directly Teleport to the reported player Cooldown infinity pages Pictures: Listed by Each User: When you Click on it, you can see all reports: by clicking on 1 report, it gets deleted, or you use the delete all button Command: /report <player> <reason> /reports to view the reports I hope you like it, if you find any bugs or have any Suggestions, be sure you let me know of it CODE: options: permission: report.Admin # Permission Prefix: &6Server &7 # Prefix NoPermMessage: &cYou don't have the permissions to use this Command! cooldown: 15 seconds # Cooldown, so people cant spam it CooldownMessage: &7Please wait &7[&c%remaining time%&7] CooldownBypass: report.bypass command /report [<offline player>] [<text>]: cooldown: {@cooldown} cooldown message: {@CooldownMessage} cooldown bypass: {@CooldownBypass} trigger: if arg-1 is not set: send "&cUsage: /report <player> <reason>" else: if arg-2 is not set: send "&cUsage: /report <player> <reason>" else: set {_hasPlayed} to 1 if arg-1 has played before set {_hasPlayed} to 1 if arg-1 is online if {_hasPlayed} is set: add arg-1 to {reports::list::*} if {reports::list::*} does not contain arg-1 add arg-2 to {reports::%arg-1%::reason::*} add player to {reports::%arg-1%::reporter::*} add now to {reports::%arg-1%::time::*} set {reports::%arg-1%::last} to now set {_p} to player #Report Message: send "{@Prefix} &7You have reported [%arg-1%&7]" send "{@Prefix} [%player%&7] &7has reported [&c%arg-1%&7] &7[<command:/reports>&aClick me<reset>&7]" to all players where [input has permission "{@permission}"] else: send "{@Prefix} This Player has never played here before" command /reports [<offline player>]: trigger: if player has permission "{@permission}": if arg-1 is offline player: playerReport(player,arg-1) else: reports(player) else: send "{@NoPermMessage}" send "&7[&cReport&7] &cMade by Sorbon" # Reports is the Main GUI with the player listed # playerReport is the GUI where the Reports of a player are listed # Create the default layout for GUI function gui(p:player,s:string,n:string): set metadata tag {_s} of {_p} to chest inventory with 6 rows named {_n} set slot (all numbers between 0 and 54) of metadata tag {_s} of {_p} to light gray stained glass pane named "" set slot 0,1,2,3,4,5,6,7,8,36,37,38,39,40,41,42,43 and 44 of metadata tag {_s} of {_p} to gray stained glass pane named "" # This function allows me to split a list at a certain value, so its used for the pagination # also allows me to say how many values it should return ({_i}) function listSplit(o:objects,i:number,offset:number = 0) :: objects: loop {_i} times: set {_l::%loop-number%} to (loop-number+{_offset})th element of {_o::*} return {_l::*} # main Gui, where the players are listed function reports(p:player,page:number=0): set {_b} to ({_page}+1)*27 # small calculation, so i can test if the GUI needs another page gui({_p},"Reports","&7Reports") set {_l::*} to listSplit({reports::list::*},27,{_page}*27) # Page starts at 0 loop {_l::*}: set slot loop-index parsed as number+8 of metadata tag "Reports" of {_p} to skull of loop-value named "%loop-value%" set slot 45 of metadata tag "Reports" of {_p} to arrow named "Page %{_page}%" if {_page} > 0 set slot 49 of metadata tag "Reports" of {_p} to barrier named "&cClose" set slot 53 of metadata tag "Reports" of {_p} to arrow named "Page %{_page}+2%" if {reports::list::%{_b}%} is set # This checks if the list is set at that integer, so I don't have useless arrows in it :* open (metadata tag "Reports" of {_p}) to {_p} function playerReport(p:player,pr:offline player,page:number=0): set {_b} to ({_page}+1)*27 # for the next Page gui({_p},"PlayerReport","%{_pr}'s name%'s reports") # I need to reverse the list so i can get the newest reports first set {_reports::*} to listSplit((reversed {reports::%{_pr}%::reason::*}),27,{_page}*27) set {_reporter::*} to listSplit((reversed {reports::%{_pr}%::reporter::*}),27,{_page}*27) set {_time::*} to listSplit((reversed {reports::%{_pr}%::time::*}),27,{_page}*27) loop {_reports::*}: set slot loop-index parsed as number +8 of metadata tag "PlayerReport" of {_p} to paper named "&6Report ##%loop-index parsed as number+ ({_page}*27)%" with lore "","&7Reason: %loop-index%", split({_reports::%loop-index%}),"", "&7Reported by: %{_reporter::%loop-index%}%" and "&7Date: %{_time::%loop-index%}%" set slot 4 of metadata tag "PlayerReport" of {_p} to skull of {_pr} named "%{_pr}%" set slot 45 of metadata tag "PlayerReport" of {_p} to arrow named "Page %{_page}%" if {_page} > 0 set slot 47 of metadata tag "PlayerReport" of {_p} to structure void named "&cDelete all Reports" set slot 49 of metadata tag "PlayerReport" of {_p} to book and quill named "&cBack to reports" set slot 51 of metadata tag "PlayerReport" of {_p} to light gray glass pane named "&7Suggest features :*" set slot 53 of metadata tag "PlayerReport" of {_p} to arrow named "Page %{_page}+2%" if {reports::%{_pr}%::reason::%{_b}%} is set open (metadata tag "PlayerReport" of {_p}) to {_p} # This basicly makes the lore more readable, i tried to make it nicer and readable, but it always broke # live with it.... xD # it basicly create splits a string at words, and tries to create strings which arent longer than 30 characters # if a word is longer than 30 characters, it splits that word function split(list:string) :: strings: set {_list::*} to {_list} split at " " set {_n} to "&7" loop {_list::*}: set {_m} to loop-value while length of {_m} > 30: set {_n} to "%{_n}% %first (30 - length of {_n}) characters of {_m}%" add {_n} to {_n::*} set {_n} to "&7" replace all first 30 characters of {_m} with "" in {_m} set {_n} to "%{_n}% %{_m}%" if length of {_n} > 30: add {_n} to {_n::*} set {_n} to "&7" add {_n} to {_n::*} if {_n} is not "" return {_n::*} function verify(p:player,p2:offline player,id:integer): set metadata tag "verify" of {_p} to chest inventory with 3 rows named "&7Do you want to delete this Report?" set slot (all numbers between 0 and 26) of metadata tag "verify" of {_p} to light gray stained glass pane named "" set slot 10 and 11 of metadata tag "verify" of {_p} to lime glass pane named "&aYES" set slot 15 and 16 of metadata tag "verify" of {_p} to red glass pane named "&cNo" set slot 4 of metadata tag "verify" of {_p} to skull of {_p2} named "%{_p2}%" set slot 13 of metadata tag "verify" of {_p} to paper named "&cAre you sure?" with lore "&7Are you sure you want", "&7to delete Report ##%{_id}%?" open (metadata tag "verify" of {_p}) to {_p} function deleteReport(pr:player,p:offline player,id:integer): # since the ID are reversed inside the gui, to show the newset, i have to calulate which report it actually wants to delete # so i take the size+1 and subtract the ID set {_id} to size of {reports::%{_p}%::reason::*}+1-{_id} if {_id} != -1 # -1 is basicly to delete all reports delete {reports::%{_p}%::reason::%{_id}%} delete {reports::%{_p}%::reporter::%{_id}%} delete {reports::%{_p}%::time::%{_id}%} delete {reports::%{_p}%::*} if {_id} = -1 # deletes all of them playerReport({_pr},{_p}) # if player has no reports to show, it shows the main page if size of {reports::%{_p}%::reason::*} = 0: remove {_p} from {reports::list::*} reports({_pr},0) fixVariable({_p}) # lists index get messed up when you delete a variable in it, so i reset it here function fixVariable(p:player): set {reports::%{_p}%::reason::*} to {reports::%{_p}%::reason::*} set {reports::%{_p}%::reporter::*} to {reports::%{_p}%::reporter::*} set {reports::%{_p}%::time::*} to {reports::%{_p}%::time::*} on inventory click: if event-inventory = (metadata tag "Reports" of player): cancel event reports(player,(2th element out of (name of event-slot split at " ") parsed as number-1)) if name of event-slot contains "Page" close player's inventory if name of event-slot is "&cClose" playerReport(player,name of event-slot parsed as offline player) if size of {reports::%name of event-slot%::reason::*} > 0 if event-inventory = (metadata tag "PlayerReport" of player): cancel event reports(player,0) if name of event-slot is "&cBack to Reports" deleteReport(player,(slot 4 of player's current inventory's name parsed as offline player),-1) if name of event-slot is "&cDelete all Reports" if name of event-slot contains "Report ##": # gets the ID of the event-slot set {_n} to 2th element out of (name of event-slot split at " ") replace all "##" with "" in {_n} verify(player,slot 4 of player's current inventory's name parsed as offline player,( {_n} parsed as integer)) playerReport(player,slot 4 of player's current inventory's name parsed as offline player,(2th element out of (name of event-slot split at " ") parsed as number-1)) if name of event-slot contains "Page" if event-inventory = (metadata tag "verify" of player): cancel event playerReport(player,slot 4 of player's current inventory's name parsed as offline player) if name of event-slot is "&cNO" if name of event-slot is "&aYES": # Need to get the ID secretly :3 set {_n} to last element of (line 2 of lore of slot 13 of player's current inventory split at " ") replace all "##" and "?" with "" in {_n} deleteReport(player,slot 4 of player's current inventory's name parsed as offline player,{_n} parsed as integer) on inventory close: # 1.16.1 came with a new feature, that you can press F inside a gui, i made a temp fix here for that set offhand tool to {offhand::%player%} if event-inventory = (metadata tag "Reports" of player) set offhand tool to {offhand::%player%} if event-inventory = (metadata tag "PlayerReport" of player) skReport.sk
  11. Features:Custom MessagesPermission based VaultsAdmin Command to open other player's VaultsRequirements:Skript:Tuske:SkQuery: Information:It's my first "public" Skript i've ever made. The max. Vault per player can easly be set per permissions, like "pv.10" for 10 playervaults.The Chatmessages can all be edited in the Options, as well as the maximum vaults.If you have any Suggestions about it, let me know.... I'm still very unexperienced, but i hope you like the Skript and it will fit in your Server!Commands:/pv [vault number]/pvadmin [player] [vault number]How to install:move both files on your script folder Playervault.sk TabCompleter.sk
  12. RandomItem Plugins needed:SkriptSkRayFallDescription:It gives everyone on the server a random item every X seconds.The time, boss bar and black list can be edited within the skript, just open it with a regular text editor.Features:Timer can be changedBossBar name, color can be changedBlack list for removing items that you do not want to give to people. toggleIf there are any suggestions or bugs, contact me if there are any discrepancies: Sorbon#1337 CODE: #---------------------------------------< Skript made by Sorbon >---------------------------------# options: time: 20 # 5, 10, 15, 20... are the best times, :D bossbar: True # True or False # needs restart bossbarColor: green BossBarName: &aRandom Item in: &7[&c%{_timer}%&7] #---> %{_timer}% is the Timer #------------------------------------------------------------------------# # THe Blacklist, everthing here wont be given to the player! # ps: remove the items here, if you want to give it to the player xD #------------------------------------------------------------------------# Blacklist: bedrock, command block and barrier and stone #------------------------------------------------------------------------------------------------# # Do not edit the code below without knowing what you're doing on load: set {_timer} to 0 create bossbar titled "{@BossBarName}" and id "randomdrop" for all players with progress 100 with colors {@bossbarColor} if "{@bossbar}" = "True" on join: add bossbar "randomdrop" for player if "{@bossbar}" = "True" command /toggle: trigger: if {toggle::%player%} is set: delete {toggle::%player%} send "You are getting Items now!" else: set {toggle::%player%} to true send "You don't get any Items now :c" command /random [<string>]: trigger: if player has permission "random.admin": if arg-1 is "Pause","Break" or "stop": set {break} to true send "&cYou stopped the Countdown" if arg-1 is "continue","unstop" or "start": send "&cYou started the countdown" delete {break} if arg-1 is not set: send "&7------<&aRandomItem by Sorbon&7>------" send "&7-> &aUse &c/random Pause &a| &cStop &ato stop the Countdown!" send "&7-> &aUse &c/random Continue &a| &cStart &ato start the Countdown!" else: send "&7------<&aRandomItem by Sorbon&7>------" send "&7-> &cYou don't have the permissions to use this command!" Every {@time} seconds: set bossbar "randomdrop" value to 100 if "{@bossbar}" = "True" loop 100 times: if {break} is set: set {_timer} to "Paused" set bossbar "randomdrop" title to "{@BossBarName}" if "{@bossbar}" = "True" set bossbar "randomdrop" value to 100 if "{@bossbar}" = "True" stop set {_s} to {@time}/100 wait ("%{_s}% seconds" parsed as timespan) set bossbar "randomdrop" value to (value of bossbar "randomdrop" - 1) if "{@bossbar}" = "True" set {_timer} to ceil({_s} * value of bossbar "randomdrop") if "{@bossbar}" = "True" set bossbar "randomdrop" title to "{@BossBarName}" if "{@bossbar}" = "True" loop all players: while {_bool} is not true: set {_item} to random element out of all items set {_bool} to true if {@Blacklist} does not contain {_item} wait 1 tick give loop-player {_item} if {toggle::%loop-player%} is not set RandomItem V 1.2.sk
×
×
  • Create New...