Jump to content

kegnh

Member
  • Posts

    35
  • Joined

  • Last visited

  • Days Won

    6

Posts posted by kegnh

  1. Hello, my name is itskegnh, and ill be showing you how to layout code in your scripts.
    This tutorial assumes you've read my other tutorials.
     



    A block of skript code contains 3 things.

    • An Event
    • A Condition (optional)
    • And An Effect

    What is an Event?
        An event is a section of code that triggers when something happens (e.g. when a player joins)
        An Example event would be: on join: which triggers when a player joins

    What is a Condition?
        A Condition is a check, and will only run the rest of the code if a condition or check is met.
        An Example of a condition would be: If player is online: which will only run if the player is online.

    What is an Effect?
        An Effect is a line of code that does something. These are the lines of code that effect players or change things.
        An Example of an effect would be: kill the player  Which would kill the player.

    Formatting Code?
    An Example of This would be:

    EVENT:
    	IF CONDITION:
    		EFFECT
    	ELSE:
    		EFFECT

    The conditions are optional

    What would be an example of code that actually looks like this?
    Well for that we could make a script that sends "welcome to the server!" if its their first time joining the server.

    on join:
    	if all offline players doesn't contains player:
    		send "Welcome to the server!"

    This triggers when a player joins, checks if offline players contains player (offline players is a list of all players who have joined your server), and if it doesn't sends "Welcome to the server!"

     



    If you would like to see more of these (The Next: Variables) leave a like or a comment! 👍. Have a nice day.

     
    • Like 2
  2. Hello, my name is itskegnh, and ill be showing you how to use indentation in your scripts.
    This tutorial assumes you've read my other tutorials.

    Indentation is how you allocate sections of code to events (more about events in a later tutorial).
    How do i indent? Well you pick one of the following common Indentation techniques:

    1. 4 Spaces
    2. 2 Spaces
    3. 1 Tab

    I prefer to use 1 Tab but it is entirely up to you.
    How do you indent?
    You place the selection above after a colon (:)
    For Example:

    on join:
    	send "Welcome!"

    As you can see in this example, the line send "Welcome!" is indented by 1 tab.
    This means that when the event is called (when a player joins), It will send Welcome.
    When a colon (:) is at the end of a line, you always indent.

    If you would like to see more of these (The Next: Simple Layout) leave a like or a comment! 👍. Have a nice day.

     

    • Like 1
  3. Hello, my name is itskegnh, and ill be showing you how to get skript on your server.
    This tutorial assumes you know how to use Minehut.

    1.  Install the Skript Plugin.
      To Install the skript plugin navigate to the Plugins tab in your server dashboard.
      Search Skript, and install the one that says: Skript. Not: Skript Addon:.
      Restart The Server.
       
    2. Create A Skript File.
      Navigate to the File Manager tab in your server dashboard.
      Click Plugins, Click Skript, Click Scripts.
      Create a new file named main.sk.
       
    3. Add Code To The Skript File.
      Open your main.sk file.
      Copy/Paste your code into the file.
      Scroll down to the bottom.
      Click Save File.
       
    4. Reload Your Code In Game.
      Join your server.
      (You have to be operator.)
      Run command /sk reload main
      Test your code!

    If you would like to see more of these (The next being actual Skript) leave a like or a comment! 👍. Have a nice day.

     
     
    • Like 3
  4. # SKegnh - Dupe Skript
    # made by itskegnh#9344
    
    options:
    	# Permissions
        dupe-permission: skegnh.dupe
        random-item-permission: skegnh.item
        toggle-item-permission: skegnh.toggle
        blacklist-permission: skegnh.blacklist
        
        # Messages
        permission-message: &cInsufficient Permissions
        dupe-message: &f[&cSKegnh&f] &7Duped your hand.
        toggle-message: &f[&cSKegnh&f] &7toggled your item drops.
        inventory-full: &f[&cSKegnh&f] &7You do not have enough inventory space.
        blacklist-add: &f[&cSKegnh&f] &7Added.
        blacklist-remove: &f[&cSKegnh&f] &7Removed.
        
        # Other
        world: world
        cooldown: 0 seconds
    
    command /dupe:
        trigger:
            if player doesn't have permission "{@dupe-permission}":
                send "{@permission-message}" to player
                stop
            if player can hold player's tool:
                give player player's tool
                send "{@dupe-message}"
                stop
            send "{@inventory-full}"
    
    command /toggle:
        trigger:
            if player doesn't have permission "{@toggle-item-permission}":
                send "{@permission-message}" to player
               	stop
            add player's uuid to {toggle::*} if {toggle::*} doesn't contain player's uuid
            remove player's uuid from {toggle::*} if {toggle::*} contains player's uuid
            send "{@toggle-message}" to player
    
    command /blackist <text="add">:
        trigger:
            if player doesn't have permission "{@toggle-item-permission}":
                send "{@permission-message}" to player
                stop
            if arg-1 = "add":
                add type of player's tool to {blacklisted.items::*}
                send "{@blacklist-added}" to player
            else if arg-1 = "remove":
                remove type of player's tool from {blacklisted.items::*}
                send "{@blacklist-removed}" to player
                
    every {@cooldown} in world "{@world}":
        give all players where [player input has permission "{@random-item-permission}" and {toggle::*} doesn't contain player input's uuid] 1 of (random element out of all items where [{blacklisted.items::*} does not contain type of input])

    If you need help, please DM itskegnh#9344.

  5. Hello!

    For all the people asking for shop GUIs

    Give me more information...

    What would you like in the shop?
    What are the prices of the items in the shop?
    What kind of layout do you want the shop to have?
    What Skript plugin do you want it to be coded to work with?
     

    I need all of the above before i can help you.

    Thankyou.

  6. command /vanish:
      permission: vanish.use
      permission message: &cInsufficent permissions.
      aliases: /v
      trigger:
    	if {vanish::%player's uuid%} is set:
    		hide player from players where [input does not have permission "vanish.bypass"]
    		send action bar "Vanished!" to player
    		set {vanish::%player's uuid%} to true
    	else:
    		reveal player from all players
    		delete {vanish::%player's uuid%}
            send action bar "You are no longer vanished!" to player

    hope this helps 😄

    tell me if there are any errors i haven't tested it 👍.

    • Like 1
×
×
  • Create New...