Quit Reason Skript

  • 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 community!

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

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Shazad

Member
Mar 25, 2017
4
0
1
Hi im using newest skript version on Paper Spigot 1.15.2 server

I want to make something like

On quit:
Set quit message to "&c- &4%player% %disconnect reason%"

But idk how, i heard that skellet has something that could help me.

thanks
 
Code:
on quit:
    set quit message to "your message here"

all you needed was 4 spaces on the second line.

EDIT: I don't know how you would make a disconnect reason. The only way that would work is if you had like a custom /disconnect <reason> command. I am new here so I don't know much... :emoji_frowning: srry
 
I know that i didn't add spaces btw i preffer tabs but it doesn't matter right now.

Im talking about something like
set {_r} to method "getReason"
send "%player% discconected with reason {_r}"

I saw it on skellet but i does not work for me
 
There isn't any syntax that fetches a quit reason (probably because Minecraft doesn't provide a reason for disconnection), so this is most likely impossible.
 
Hi im using newest skript version on Paper Spigot 1.15.2 server

I want to make something like

On quit:
Set quit message to "&c- &4%player% %disconnect reason%"

But idk how, i heard that skellet has something that could help me.

thanks
I think there's no a ''disconnect reason'' in Skript. But, you can make a /disconnect or /logout command for that, something like this:
Code:
command /logout [<text>]:
    aliases: disconnect
    executable by: players
    usage: &c/logout <reason>
    trigger:
        if arg-1 is not set:
            if {logoutReason.%player%} is not set:
                set {logoutReason.%player%} to "%arg-1%"
                send "&aYou have set your quit reason to &f%arg-1%&a."
            else:
                send "&aUpdated your quit reason from &c%{logoutReason.%player%}% &ato &f%arg-1%&a."
                set {logoutReason.%player%} to "%arg-1%"
        else:
            send "&cUsage: /logout <reason>"

on join:
    if {logoutReason.%player%} is not set:
        set {logoutReason.%player%} to "Jus't don't wanna play."

on quit:
    set quit message to "&c- &4%player% &7left the server for &f'%{logoutReason.%player%}%'&7."

Btw, I think something like this doesn't make any sense
 
Status
Not open for further replies.