Jump to content

Essentials Skript


SIG12

Recommended Posts

Commands:

 

/gmc - Sets your gamemode to Creative

/gms - Sets your gamemode to Survival

/gma - Sets your gamemode to Adventure

/gmsp - Sets your gamemode to Spectator

/spawn - Teleports you to the set spawn

/setspawn - Sets the world spawn 

/delspawn - Deletes spawn 

/clear - It will clear a player's inventory

/repair - Repair's your held item 

/ec - Opens a players enderchest 

/invsee - Opens a players inventory

/tp - Teleports to a player 

/tphere - Teleports a player to you

/tpall - Teleports all online players to you 

/home - Teleports you to your home

/sethome - Sets your home to your current location

/delhome - Lets you delete your home 

/enchant - Enchants your held item to a minecraft enchantment

/kill - Kills a player 

/suicide - Kills you

/trash - Opens the trash menu

 

 

Note: I only included the important ones and didn't want to include the punishments ones like the mutes and stuff. 

 

Code:

# Essentials Skript
# Made by SIG12 
# DISCLAIMER: There is no /ban, /kick and other punishment stuff, It also doesn't have ALOT of the commands and such. I made this just for the important commands and the most useful commands.


# Options

options:
    
    # Misc/Other

    p: &8[&9Essentials&8]

    # Permission

    perm: essential.use # Perm Here  
    noperm: &cYou cannot do this command! # No Perm message here 

    # Sounds 

    success: play sound "entity.experience_orb.pickup" with volume 1 to the player
    fail: play sound "entity.bat.death" with volume 1 to the player
    tpsound: play sound "entity.enderman.teleport" with volume 2 to player   

# Gamemode

command /gmc [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            gamemode(player, creative)
            send "{@p} &7You have set &e%player%&7's gamemode to &bCreative!" to player 
            {@success}
        else:
            gamemode(arg-1, creative)
            send "{@p} &7You have set &e%player%&7's gamemode to &bCreative!" to player 
            {@success}

command /gms [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            gamemode(player, survival)
            send "{@p} &7You have set &e%player%&7's gamemode to &bSurvival!" to player 
            {@success}
        else:
            gamemode(arg-1, survival)
            send "{@p} &7You have set &e%player%&7's gamemode to &bSurvival!" to player 
            {@success}

command /gmsp [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            gamemode(player, spectator)
            send "{@p} &7You have set &e%player%&7's gamemode to &bSpectator!" to player 
            {@success}
        else:
            gamemode(arg-1, spectator)
            send "{@p} &7You have set &e%player%&7's gamemode to &bSpectator!" to player 
            {@success}

command /gma [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            gamemode(player, adventure)
            send "{@p} &7You have set &e%player%&7's gamemode to &bAdventure!" to player 
            {@success}
        else:
            gamemode(arg-1, adventure)
            send "{@p} &7You have set &e%player%&7's gamemode to &bAdventure!" to player 
            {@success}

# Spawn 

command /spawn:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if {spawn} is set:
            teleport player to {spawn}
            send "{@p} &eYou have teleported to spawn!"
            {@tpsound}
        else:
            send "{@p} &cSpawn is not set!"
            {@fail}

command /setspawn:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        set {spawn} to player's location 
        send "{@p} &eYou have set spawn to &b%{spawn}%"
        {@success}

command /delspawn:
    aliases: /deletespawn, /unsetspawn, /spawnunset
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if {spawn} is set:
            delete {spawn}
            send "{@p} &cYou deleted your spawn!"
            {@success}
        else:
            send "{@p} &cSpawn is not set!"
            {@fail}

# Clear

command /clear [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            clear player's inventory
            send "&eCleared!"
            {@success}
        else:
            clear arg-1's inventory 
            send "&eCleared!"
            {@success}

# Repair

command /repair:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        repair player's held item 

# Ender Chest / Invsee 

command /ec [<player>]:
    aliases: /enderchest, /viewechest, /viewenderchest
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            open player's ender chest to player 
            send "{@p} &eViewing %player%&e's enderchest!" 
            {@success}

        else:
            open arg-1's ender chest to player 
            send "{@p} &eViewing %arg-1%&e's enderchest!" 
            {@success}

command /invsee [<player>]:
    aliases: /inventorysee, /viewinventory
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            open player's inventory to player 
            send "{@p} &eViewing %player%&e's inventory!"
            {@success}
        else:
            open arg-1's inventory to player 
            send "{@p} &eViewing %arg-1%&e's inventory!"
            {@success}

# Teleportation

command /tp [<player>]:
    aliases: /teleport 
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            send "{@p} &cYou cannot teleport yourself!"
            {@fail}
        else:
            teleport player to arg-1 
            send "{@p} &eTeleported to &e%arg-1%"
            {@success}

command /tphere [<player>]:
    aliases: /teleporthere
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            send "{@p} &cYou cannot teleport yourself!"
            {@fail}
        else:
            teleport arg-1 to player 
            send "{@p} &eTeleported %arg-1%&e to yourself!"
            {@success}

command /tpall:
    aliases: /teleportall
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        teleport all players to player 
        send "{@p} &eTeleported all players to yourself!"
        {@success}

# Homes

command /sethome:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        set {home.%player%} to player's location 
        send "{@p} &eYou have set your home!"
        {@success}

command /home:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if {home.%player%} is not set:
            send "{@p} &cYou need to set your home!"
            {@fail}
        else:
            teleport player to {home.%player%} 
            send "{@p} &eYou teleported to your home!"
            {@success}

command /delhome [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            if {home.%player%} is set:
                delete {home.%player%}
                send "&eYou have deleted your home!"
                {@success}
            else:
                send "&cYou don't have a home set!"
                {@fail}
        else if arg-1 is set:
            if {home.%arg-1%} is set:
                delete {home.%arg-1%}
                send "&eYou have deleted &e%arg-1%&e's home!"
                {@success}
            else:
                send "&c%arg-1% &cdoesn't have a home set!"
                {@fail}

# Enchant

command /enchant [<enchantment type>]:
    aliases: /ench 
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is set:
            enchant player's tool with arg-1 
            send "{@p} &eYou have enchanted your tool with &E%arg-1%"
            {@success}
        else:
            send "&CYou need an enchantment type for this!"
            {@fail}

# Suicide/Kill

command /suicide:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        kill player 
        send "&6You suicided!"
        send "&7Suicide/Self-Harm Immediate 24/7 Hotlines:"
        send "&7USA Suicide Hotline"
        send "&7Phone Number: 1-800-273-8255"

command /kill [<player>]:
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            kill player 
            send "&eYou killed yourself!"
            {@success}
        else:
            kill arg-1
            send "&eYou killed %arg-1%"
            {@success}

# Trash

command /trash:
    aliases: /disposal
    trigger:
        trash(player)

on inventory click:
    if name of player's inventory is "&eDisposal":
        if event-slot is 45 or 46 or 47 or 48 or 50 or 51 or 52 or 53:
            cancel event 
        if event-slot is 49:    
            cancel event 
            close player's inventory 
            send "&6Disposed!" to player 
            {@success}

# Money System

command /bal [<player>]:
    aliases: /money, /balance
    trigger:
        if arg-1 is not set:
            send "{@p} &eYour Balance: &b%{money::%player's uuid%}%"
        else:
            send "{@p} &e%arg-1% &eBalance: &b%{money::%arg-1's uuid%}%"

command /eco [<text>] [<player>] [<integer>]:
    aliases: /ecoadmin, /eadmin, /moneyadmin
    permission: {@perm}
    permission message: {@noperm}
    trigger:
        if arg-1 is not set:
            send "&8-----------------"
            send "&e/eco give (player) (number)"
            send "&dEx. /eco give &d%player%&d 10"
            send ""
            send "&e/eco reset (player)"
            send "&dEx. /eco reset &d%player%"
            send ""
            send "&e/eco set (player) (number)"
            send "&dEx. /eco set &d%player% &d10"
            send ""
            send "&e/eco remove (player) (number)"
            send "&dEx. /eco remove &d%player% &d10"
            {@success}
            send "&8-----------------"
        else if arg-1 is set:
            if arg-1 is "give" or "add":
                if arg-2 is set:
                    if arg-3 is set:
                        add arg-3 to {money::%arg-2's uuid%}
                        send "{@p} &eYou added &E%arg-3% &eto %arg-2%&e's balance!"
                        {@success}                    
                    else:
                        send "{@p} &cYou need a number!"
                        {@fail}
                else:
                    send "{@p} &cYou need a player!"
                    {@fail}

            if arg-1 is "reset":
                if arg-2 is set:
                    if arg-3 is set:
                        set {money::%arg-2's uuid%} to 0  
                        send "{@p} &eYou reseted &e%arg-2%&e's balance!"
                        {@success}
                    else:
                        send "{@p} &cYou need a number!"
                        {@fail}
                else:
                    send "{@p} &cYou need a player!"
                    {@fail}

            if arg-1 is "set":
                if arg-2 is set:
                    if arg-3 is set:
                        set {money::%arg-2's uuid%} to arg-3 
                        send "{@p} &eYou set &E%arg-3%&e's balance to &e%arg-2%&e!"
                        {@success}
                    else:
                        send "{@p} &cYou need a number!"
                        {@fail}
                else:
                    send "{@p} &cYou need a player!"
                    {@fail}

            if arg-1 is "remove":
                if arg-2 is set:
                    if arg-3 is set:
                        remove arg-3 from {money::%arg-2's uuid%}
                        send "{@p} &eYou removed &E%arg-3% from &e%arg-2%&e's balance!"
                        {@success}
                    else:
                        send "{@p} &cYou need a number!"
                        {@fail}
                else:
                    send "{@p} &cYou need a player!"
                    {@fail}


on join:
    if {money::%player's uuid%} is not set:
        set {money::%player's uuid%} to 0 


# Functions

function gamemode(p: player, t: gamemode):
    set {_p}'s gamemode to {_t}

function trash(p: player):
    set {_trash} to a new chest inventory with 6 rows with name "&eDisposal"
    set slot 49 of {_trash} to barrier named "&cTrash"
    set slot 45 and 46 and 47 and 48 and 50 and 51 and 52 and 53 of {_trash} to gray stained glass pane named "&8"
    send "&eOpening disposal.." to {_p}
    open {_trash} to {_p} 

 

Link to comment
Share on other sites

4 hours ago, chipchipy said:

hey i made a smp type of thing for me and my friends and  i want to add this to it but i dont know how

If you don't understand just follow this video (Follow how they install skript, put the skript into the files and it should be all good from there):

 

 

 

Okay so, basically you first add the plugin "Skript" to your server. You can manually add it if you'd like, download the skript plugin here: https://github.com/SkriptLang/Skript/releases 

 

Then once you're finished downloading it, start your server, go to "File Manager" then go to "Plugins" press the "Upload File" then once you're done uploading skript into your server, restart it.

 

Then when you're done adding skript, you should have this folder in your plugins tab, then click on itimage.png.151def4a1edfb4ecdce2a0fbf636b085.png

 

Click on this:

image.png.7edae1edf4413e0dee660dbaeaf0e847.png

 

Create a file, name it whatever you want but add .sk at the end, then paste the skript into the file, go in game then type "/sk reload (file name)"

Then it should be done

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...