Hello! I need a customed coded skript for my SMP!

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

JesterThr0ugh

Member
Jun 2, 2024
47
0
6
24
Hello guys! Im starting a SMP called 'Reaper SMP' and i got a good twist!

When you kill a player you get a cog (A effect) that is perm, until you die (player) it goes down by 1 level, or when you kill someone it guys up by 1, if u have 1 level and you get killed you get no effect. With these cogs when you do /withdraw or /buy (Your choice) You can buy enchants. Oh i forgot to say, you cant use a anvil or a enchanting table. The only wway to enchant something is with cogs, When you put in cogs, it will enchant the item you put in the slot, more cogs you have, better and higher tiers, (level 5 and 4 enchants should be 10 - 15 cogs), when you kill someone a boss bar will appear at the top of the screen like the dragon with a 5 minute timer, you wont get any cogs until it finishes.

make sure you dm me on discord 'anotherdumbcoder'

Thank you! (Also you will get a special role in the discord server)
Also i dont know if we can create effects with skript, so maybe we can make it on the scoreboard or boss bar.
 
Last edited:
options:
cogName: "cog"
maxLevel: 5
cooldown: 3000
enchantCosts: 10 # Cost for level 4 enchant
enchantCostsHigh: 15 # Cost for level 5 enchant

variables:
{cogs::%uuid%} = 0
{lastKillTime::%uuid%} = 0

on death of player:
if victim is a player:
if {cogs::%uuid of attacker%} > 1:
modify {cogs::%uuid of attacker%} by 1
else:
set {cogs::%uuid of attacker%} to 0

on death of player:
if attacker is a player:
modify {cogs::%uuid of attacker%} by 1

command /withdraw:
trigger:
if {cogs::%uuid%} >= 1:
# Handle withdrawal logic and enchantment based on cogs
remove {cogs::%uuid%} by 1
# Enchant item as needed

command /buy:
trigger:
if {cogs::%uuid%} >= 10:
# Handle buying logic and enchantment based on cogs
remove {cogs::%uuid%} by 10
# Enchant item as needed

every 1 second:
loop all players:
if {lastKillTime::%uuid%} + cooldown > now:
send action bar to player "You cannot gain cogs for another %{cooldown / 1000}% seconds!"

on kill of player:
if attacker is a player:
set {lastKillTime::%uuid of attacker%} to now
send boss bar to attacker with title "Cogs Buff Active!" with color red and timeout 5 minutes
send "You are on a kill streak! You have %{cogs::%uuid of attacker%}% cogs."
 
options:
cogName: "cog"
maxLevel: 5
cooldown: 3000
enchantCosts: 10 # Cost for level 4 enchant
enchantCostsHigh: 15 # Cost for level 5 enchant

variables:
{cogs::%uuid%} = 0
{lastKillTime::%uuid%} = 0

on death of player:
if victim is a player:
if {cogs::%uuid of attacker%} > 1:
modify {cogs::%uuid of attacker%} by 1
else:
set {cogs::%uuid of attacker%} to 0

on death of player:
if attacker is a player:
modify {cogs::%uuid of attacker%} by 1

command /withdraw:
trigger:
if {cogs::%uuid%} >= 1:
# Handle withdrawal logic and enchantment based on cogs
remove {cogs::%uuid%} by 1
# Enchant item as needed

command /buy:
trigger:
if {cogs::%uuid%} >= 10:
# Handle buying logic and enchantment based on cogs
remove {cogs::%uuid%} by 10
# Enchant item as needed

every 1 second:
loop all players:
if {lastKillTime::%uuid%} + cooldown > now:
send action bar to player "You cannot gain cogs for another %{cooldown / 1000}% seconds!"

on kill of player:
if attacker is a player:
set {lastKillTime::%uuid of attacker%} to now
send boss bar to attacker with title "Cogs Buff Active!" with color red and timeout 5 minutes
send "You are on a kill streak! You have %{cogs::%uuid of attacker%}% cogs."
oh mate thanks! but i already got it! Can u make some edits to this skript?
 
When u kill a player, a cooldown with a 1 minute and a half starts, you gain a cog, they lose a cog, can go into negatives, when i do /withdraw it takes 1 cog and i get a item, with this item its like a heart from lifesteal, but gives u a cog, then /cogenchant (amout of cogs) (level of enchant) so if i want mending i can do /cogenchant 5 1, but i may get a curse instead
 
Code:
on load:
    delete {sword3::*}
    delete {sword2::*}
    delete {sword1::*}
    add "sharpness" and "fire aspect" and "mending" to {sword3::*}
    add "smite" and "fire aspect" and "looting" to {sword2::*}
    add "bane of arthropods" and "Sweeping Edge" to {sword1::*}
    delete {pick3::*}
    delete {pick2::*}
    delete {pick1::*}
    add "efficiency" and "fortune" to {pick3::*}
    add "silk touch" to {pick2::*}
    add "unbreaking" to {pick1::*}
    delete {axe3::*}
    delete {axe2::*}
    delete {axe1::*}
    add "fortune" and "sharpness" to {axe3::*}
    add "efficiency" to {axe2::*}
    add "silk touch" and "unbreaking" to {axe1::*}
    delete {boot3::*}
    delete {boot2::*}
    delete {boot1::*}
    add "frost walker" and "protection" to {boot3::*}
    add "thorns" to {boot2::*}
    add "Depth Strider" and "unbreaking" to {boot1::*}
    delete {helm3::*}
    delete {helm2::*}
    delete {helm1::*}
    add "protection" to {helm3::*}
    add "thorns" to {helm2::*}
    add "respiration" and "unbreaking" to {helm1::*}
    delete {armor3::*}
    delete {armor2::*}
    delete {armor1::*}
    add "protection" to {armor3::*}
    add "thorns" and "blast protection" to {armor2::*}
    add "unbreaking" and "fire protection" to {armor1::*}
    delete {bow3::*}
    delete {bow2::*}
    delete {bow1::*}
    add "power" to {bow3::*}
    add "punch" to {bow2::*}
    add "unbreaking" to {bow1::*}
    delete {tri3::*}
    delete {tri2::*}
    delete {tri1::*}
    add "riptide" to {tri3::*}
    add "loyalty" to {tri2::*}
    add "unbreaking" to {tri1::*}
    delete {cross3::*}
    delete {cross2::*}
    delete {cross1::*}
    add "multishot" to {cross3::*}
    add "piercing" to {cross2::*}
    add "unbreaking" to {cross1::*}



on join:
    if {players::*} does not contain player:
        add player to {players::*}
        set {cob::%player%} to 0
        
on death:
    if attacker is player:
        if victim is player:
            if {cooldown::%attacker%} is 0:
                add 1 to {cob::%attacker%}
                remove 1 from {cob::%victim%}
                set {cooldown::%attacker%} to 120
            if {cooldown::%attacker%} is not set:
                add 1 to {cob::%attacker%}
                set {cooldown::%attacker%} to 120
        
every second:
    loop all players:
        if {cooldown::%loop-player%} is set:
            if {cooldown::%loop-player%} is more than 0:
                remove 1 from {cooldown::%loop-player%}
                set {_cooldown} to "%{cooldown::%loop-player%}% seconds" parsed as a timespan
                send action bar "&L&cCogs: &f%{cob::%loop-player%}% / &cCooldown: &f%{_cooldown}%" to loop-player
            else:
                send action bar "&L&cCogs: &f%{cob::%loop-player%}%" to loop-player
        else:
            send action bar "&L&cCogs: &f%{cob::%loop-player%}%" to loop-player
        
        
command /withdraw [<number>]:
    trigger:
        if {cob::%player%} >= arg-1:
            if arg-1 is not less than or equal to 0:
                set {_num} to arg-1
                set {_num} to {_num} / 3
                set {enchnum::%player%} to rounded {_num}
                set {enchnum2::%player%} to arg-1
                set metadata tag "vanillaGUI" of player to chest inventory with 3 rows named "&L&cCog &fEnchanter"
                set slot 0 of metadata tag "vanillaGUI" of player to gray stained glass pane named " "
                loop 50 times:
                    set slot loop-value of metadata tag "vanillaGUI" of player to gray stained glass pane named " "
                set slot 22 of metadata tag "vanillaGUI" of player to enchantment table named "&cClick Here To &aEnchant"
                set slot 13 of metadata tag "vanillaGUI" of player to air
                open (metadata tag "vanillaGUI" of player) to player
            else:
                send "You can not withdraw less than 1 &c&LCog"
        else:
            send "you need more &L&cCogs"
command /setcogs [<number>]:
    permission: op
    trigger:
        set {cob::%player%} to arg-1
            
on inventory click:
    if type of event-inventory is anvil inventory:
        cancel event
        close player's inventory
    if type of event-inventory is enchanting table inventory:
        cancel event
        close player's inventory

on inventory click:
    if event-inventory = (metadata tag "vanillaGUI" of player):
        if index of event-slot is 22:
            if slot 22 of current inventory of player is a enchantment table:
                if slot 13 of current inventory of player is a sword:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {sword1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {sword2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {sword3::*}
                if slot 13 of current inventory of player is a pickaxe:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {pick1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {pick2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {pick3::*}
                if slot 13 of current inventory of player is a axe:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {axe1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {axe2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {axe3::*}
                if slot 13 of current inventory of player is a helmet:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {helm1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {helm2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {helm3::*}
                if slot 13 of current inventory of player is boots:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {boot1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {boot2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {boot3::*}
                if slot 13 of current inventory of player is leggings or chestplate:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {armor1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {armor2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {armor3::*}
                if slot 13 of current inventory of player is shield:
                    set {_item} to slot 13 of current inventory of player
                    set {_enchant} to "unbreaking"
                if slot 13 of current inventory of player is a trident:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {tri1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {tri2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {tri3::*}
                if slot 13 of current inventory of player is a bow:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {bow1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {bow2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {bow3::*}
                if slot 13 of current inventory of player is a crossbow:
                    set {_item} to slot 13 of current inventory of player
                    if {enchnum::%player%} is less than or equal to 2:
                        set {_enchant} to random element out of {cross1::*}
                    if {enchnum::%player%} is more than 2:
                        if {enchnum::%player%} is less than or equal to 4:
                            set {_enchant} to random element out of {cross2::*}
                    if {enchnum::%player%} is more than 4:
                        set {_enchant} to random element out of {cross3::*}
                if slot 13 of current inventory of player is not a axe or a sword or a pickaxe or a shovel or boots or leggings or chestplate or helmet or shield or trident or a bow or a crossbow:
                    cancel event
                    stop
                remove {enchnum2::%player%} from {cob::%player%}
                if {enchnum::%player%} is less than 1:
                    set {enchnum::%player%} to 1
                send "You got &a%{_enchant}% %{enchnum::%player%}%" to player
                set {_enchant} to "%{_enchant}% %{enchnum::%player%}%" parsed as enchantment type
                enchant {_item} with {_enchant}
                set slot 13 of metadata tag "vanillaGUI" of player to {_item}
                set slot 22 of metadata tag "vanillaGUI" of player to lime concrete named "&aDone"
                set {close::%player%} to true
                open (metadata tag "vanillaGUI" of player) to player
                set {close::%player%} to false
                play sound "entity.experience_orb.pickup" with volume 10 to the player
        if index of event-slot is not 13:
            cancel event
        else:
        
on inventory close:
    if event-inventory = (metadata tag "vanillaGUI" of player):
        if slot 13 of current inventory of player is not air:
            if {close::%player%} is false:
                give player slot 13 of current inventory of player