Jump to content

CoolProgrammer

Member
  • Posts

    1,077
  • Joined

  • Last visited

  • Days Won

    13

Posts posted by CoolProgrammer

  1. On 11/17/2020 at 11:47 PM, TheMangoCrew said:

    so, 1st thing... When I just copy-pasted it skript reload it gave me 19 errors jesus christ

     

    at least 8 of them was that you put 3 spaces and 1 tab on each "else if" and the "if" in the first one. You need 2 tabs there. I fixed those... There were also problems with some "number cant be integer" or smt idk i'll look into it i guess...

    They clearly mentioned that it's untested and might have many bugs.

    They also tried their best to provide you the Skript with your needs for free.

  2. I assume you meant this:

    "How do I use Skript variables in quotation marks?"

     

    This is how you do it:

    command /cooltest:
        trigger:
            set {cool} to "%player% is really cool"
            send "%{cool}%" to player

     

    Basically, if you want to use a variable in quotation marks, you surround the curly braces {} with %%

    Like soo: "%{yayMyVariable}%"

  3. I'm sorry for your loss. 😞

    If I recall correctly, WorldEdit stores your previous 15 actions performed.

    If your Dev removed the thing in less than 15 actions, then you should be able to rollback the actions using //undo 1 <your-dev-ign>.

    However if that doesn't work, I'd suggest you doing these things to prevent such stuff happening in the future:

    Have server backups enabled - This is a new Minehut feature which was added yesterday. Check the backups section because your server should have Backups enabled already. (1 backup per hour)

    Install CoreProtect - CoreProtect is a plugin which allows you and check who placed what block. You can also rollback or restore chunks. CoreProtect also hooks into WorldEdit and then logs in WorldEdit actions. These actions can be rolled back anytime, without any problem.

     

    Also, if you think that your Dev did this on purpose to grief the server, you should consider making a Player Report under the Reports forum.

    I wish you all the best!

  4. 6 hours ago, Realuid said:

    Thanks! also AgentGamerPro, what i ended up using was [<player>] or something like that. works well!

    Coolprogrammer ♥ appreciate it man.

     

    One more problem: the skript that Coolprogrammer sent does not work. it says that loop-value is used in too many different places or something.

    No worries 🙂

    Can you copy paste the errors here?

    I'll fix them for you.

  5. This is how I'd consider doing it instead of using "on first join" event:

    on join:
        if {firstjoined::*} does not contain player's uuid:
            firstJoin(player)
            add player's uuid to {firstjoined::*}
    
    function firstJoin(p: player):
        send "Welcome to server for the first time :D Edit code to do stuff when player first joins" to {_p}
        # add code here

    Skript will check if player's profile exists in your main world folder "world/playerdata/<player's uuid>.dat", and if it doesn't exist, only then it would call the "on first join" event. Wouldn't recommend using "on first join".

  6. Skript does provide sorting example skript when you first install it.

    Here is a piece of code that I used to use on my server.

    loop {balance::*}:
        add 1 to {_size}
        if {_low.to.high.list::%loop-value%} is not set:
            set {_low.to.high.list::%loop-value%} to loop-index
        else:
            set {_n} to 0
            loop {_size} times:
                set {_n} to {_n} + 1
                {_low.to.high.list::%loop-value-1%.%{_n}%} is not set
                set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
                stop loop
    set {_n} to size of {_low.to.high.list::*}
    loop {_low.to.high.list::*}:
        set {_high.to.low.list::%{_n}%} to loop-value
        set {_n} to {_n} - 1
    set {_i} to 0
    send "&8&l» &3&lTop Balances"
    loop {_high.to.low.list::*}:
        set {_player} to "%loop-value%" parsed as offline player
        set {_uuid} to uuid of {_player}
        if {_player} is not "<none>":
            add 1 to {_topnumber}
            send "&3%{_topnumber}%&8| &b%{_player}% &8| &3$&b%{balance::%{_uuid}%}%"
        add 1 to {_i}
        if {_topnumber} > 9:
            stop

    Feel free to use it, and make sure to customize it according to your needs.

  7. 4 hours ago, httpsepic said:

    tnt still blows up

    Try settings these flags:

    /region flag __global__ tnt deny
    /region flag __global__ explosion deny
    /region flag __global__ other-explosion deny

     

    Alternatively, you can set "block-tnt: true" in your WorldGuard configuration.

  8. 22 hours ago, inferno_k said:

    I typed in a command to reload the geyser on my server but it says that an internal error occured and it does nothing. 

    Could someone please help?

    This is what you can do:

    • Execute the command.

    • Execute /dl log

    • Look for the Stack Trace of the Exception caused by the plugin command.

    • Report it to the author/devs of Minehut so that they can find out the issue. You can also report it to the author of Geyser.

  9. Hi bros and bro-ettes. 🙂

    I've seen multiple people go around, asking "HoW tO mAkE a CuStOm WhItElIsT sKrIpT?!?!"

    So today, I'm going to show you how to make a custom whitelist system with Skript.

    As an example, I'll show you how to disallow a player if they have offline for 10 minutes or more.

    If they've been offline for less than 10 minutes, let them in. Or else, get lost! ❤️

    It's simple, trust me 😉

     

    What do we need???

    Command - Ofcouse we need a command for our custom whitelist system (/whitelist).

    Player Connect Event - This event is called when the player successfully joins the server. Here you can kick/disallow the player for a reason. (on connect)

    Player Quit Event - This event is called when the player leaves the server. Note that this is also called whenever the player is kicked from the server, e.g. causes like lag, /kick, /ban, etc. (on quit)

     

    How to???

    Think about it... What can be done in the "on connect" event, what can be done with the "on quit" event, and how to whitelist?

    Simple! We will use "on connect" event to check if the server is whitelisted and calculate the time the players has been offline for. Disallow them if they have been offline for 10+ minutes or else let them in👍. We will use "on quit" event to set the timestamp at when they left!

    3 things, 2 events, 1 command. Code them, and then pog!

     

    Things to keep in mind...

    Add Permission To Bypass - Oh? Aren't you disallowing ALL players if they are 10 minutes late?! What if your fellow staff members are late?! Won't that tell them to "get lost"? That's rude and not cool at all... Simply check if player has permission, and bypass if they have. (Useful if you want to allow people with a rank to bypass) 😉

     

    Coding Part 😮

    Let's start with the events!

    Starting with on connect event first?

    on connect:
        # To check if the server is whitelisted (this variable will be modified in the command code)
        if {whitelist} is set:
            # We check here if player is allowed to bypass the whitelist ;)
            if player does not have permission "whitelist.bypass":
                # Just to make sure to not let player in if they're joining late for the first time
                if {lastdisconnect::%uuid of player%} is not set:
                    kick the player due to "You're late! Get lost! (jk <3)"
                    stop
                # We set a temp variable {_leavetime} which will calculate and store the amount of time player has been offline
                set {_leavetime} to difference between {lastdisconnect::%uuid of player%} and now
                # Check if the player is offline for more than 10 minutes
                if {_leavetime} is greater than 10 minutes:
                    # Pretty rude kick message, but okay 
                    kick the player due to "You're late! Get lost! (jk <3)"
                    delete {lastdisconnect::%uuid of player%}
                    stop

     

    Now the on quit event!

    on quit:
        # Once again, just to extempt people with this permission
        if player does not have permission "whitelist.bypass":
            # This variable will store time when the player left!
            set {lastdisconnect::%uuid of player%} to now

     

    Sweet! We have our 2 events in place! Now let's do deh command.

    command /whitelist [<text>]:
        permission: whitelist.command
        permission message: &cNo bro, this command is not for you >:(
        trigger:
            if arg 1 is "on":
                if {whitelist} is not set:
                    set {whitelist} to true
                    broadcast "Whitelist was turned on! If you go offline for more than 10 minutes, you will not be able to join again! Panik"
                    stop
                send "&cWhitelist is already turned on."
            else if arg 1 is "off":
                if {whitelist} is set:
                    delete {whitelist}
                    broadcast "Whitelist was turned off!"
                    stop
                send "&cWhitelist is already turned off."
            else:
                send "&cUsage: /whitelist (on/off)"

     

    Done I guess? That's it!

    Okay, okay, want some more fancy stuff?

    Let's make it so that if the player joins in time, it will broadcast "<player> joined within <time> of leaving! Phew."

    We need another event for this. It's on join event! (Note that on join and on connect events are different)

    Here!

    on join:
        # Permission for extempting staff members
        if player does not have permission "whitelist.bypass":
            # Check if the last disconnect variable is set. This is to avoid the ugly <none> being put in the message >.>
            if {lastdisconnect::%uuid of player%} is set:
                # I hope you know what this is ;) (if not, go to the on connect event block)
                set {_timediff} to difference between {lastdisconnect::%uuid of player%} and now
                broadcast "&e%player% &fjoined back in &e%{_timediff}% &fafter leaving! Phew!!!"
                delete {lastdisconnect::%uuid of player%}

     

    Yay! This is just an example, you can change and create your own version. I'm not a native english speaker so might have embarrassing english mistakes >.> sorry.

     

    NOTE THAT I MADE THIS IN 10 MINUTES AFTER I WOKE UP. CODE QUALITY IS/MIGHT BE BAD. THE PURPOSE OF THIS IS JUST TO SHOW HOW TO MAKE A CUSTOM WHITELIST SKRIPT. THIS IS UNTESTED AND MIGHT HAVE STUPID MISTAKES AND BUGS. I WILL EDIT IT ONCE I TEST IT AND FIND BUGS.

    ❤️

    • Like 5
  10. On 11/11/2020 at 10:44 PM, AdiamondA said:

    a world 

    how do you load it because in the minehut menu i clicked save world

     

    If you have a world folder in your main file directory, then you can install Multiverse and import and load the world via /mv import <world-name>.

  11. On 11/13/2020 at 8:52 AM, SizenMC said:

    But someone could just type /lp and see i use luckperms. I just want to make a skript that allows admins to put players into groups with perms or add perms to players

    With LuckPerms, you could simply do this:

    command /givemeadmin:
        permission: admin.please
        trigger:
            execute console command "lp user %player% parent set admin"
            send "u got free admin, enjoy" to player

    The reason is, that sk-perms on Minehut doesn't work as intended. That's how I'd do it. ^

    • Thanks 1
  12. On 4/7/2020 at 12:32 AM, Ezekia said:

    Nice - kinda related to scoreboards but could you tell me what the thing is for displaying pex ranks on a scoreboard? Obviously %rank% doesn't work.

    The best way to do that would be using Ersatz (Skript Addon) and PlaceholderAPI.

     

    Once you install PlaceholderAPI, all you have to do is, execute /papi ecloud download Vault

    Vault will basically provide you with placeholders related to permissions and economy plugin. /papi ecloud placeholders Vault for a full list of placeholders.

     

    Once you install Ersatz, you will be able to grab PlaceholderAPI placeholders, and set those as variables in Skript.

    Here is an example:

    command /test:
        trigger:
            # Setting a temp variable. "%%vault_eco_balance%%" or "vault_eco_balance" both will work.
            set {_balance} to placeholder "vault_eco_balance" from player
            # Showing player their current balance. (If you have essentials/currency plugin installed)
            send "%{_balance}%" to player

     

    Now since you have Vault expansion installed, we will be able to grab and use any of these placeholders:388110695_ScreenShot2020-10-19at3_18_10PM.png.d642c557a3161b7d4bb437c63875c899.png

    Also, use /papi parse me %some_placeholder% to check which one you want to use.

     

    Also make sure you have Vault installed.

    • Like 1
  13. 4 hours ago, timocrafter2 said:

    hi got kicked banned from an oprator and i am owner is there anyway i can get back into server and unban myself and kick the oprator

    Make sure to uninstall any Permissions plugin, to prevent the other operator from banning you again. If they have "*", they override the permissions to ban other operators, and you cannot ban them. Once you remove/check the permissions database, you can put it back, and then /minecraft:pardon <username>.

×
×
  • Create New...