Skript help - Multilined ban reason messages

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

  • 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.

CustomWorldYT

Member
Jun 17, 2018
15
0
0
Hello there, my question is if it's possible to make multilined ban reasons in Skript.[/B]

Skript Version: 2.2 dev36 (Pre-release)
Skript Author: CustomWorldYT
Minecraft Version: 1.12.2

---
Code example:
code_language.skript:
command /ban <player>:
    ban arg 1 due to "Banned! \n (?) Reason... blah blah blah"

Errors on Reload:

code_language.skript:
None.

Console Errors:

code_language.skript:
Nothing... ¯\_(ツ)_/¯

Other Useful Info:

Addons using (including versions):
None there too ツ

Troubleshooting:

Have you tried searching the docs? Yes
Have you tried searching the forums? Yes
What other methods have you tried to fix it?
I tired to put \n like in Java just for sure, but it works only for Java. Is it possible with Skript? Thank you
 
If you have SkQuery, you can use %nl%
 
You have to do ban syntax by your self. Use Skript-mirror or move your post to request section.

For new line use
code_language.skript:
 %newline%
[doublepost=1529777646,1529776818][/doublepost]
code_language.skript:
effect [mehow] ban %player% due to %string%:
    trigger:
        kick expression-1 due to "%expression-2%"

Dunno how, but then I use this syntax I get banned :emoji_grinning:
 
You have to do ban syntax by your self. Use Skript-mirror or move your post to request section.

For new line use
code_language.skript:
 %newline%
[doublepost=1529777646,1529776818][/doublepost]
code_language.skript:
effect [mehow] ban %player% due to %string%:
    trigger:
        kick expression-1 due to "%expression-2%"

Dunno how, but then I use this syntax I get banned :emoji_grinning:
What's the code where you call the effect?
 
  • Like
Reactions: CustomWorldYT
Thank you everyone for your reply. However, Games, I don't want to use addons, I want Skript with no dependencies (If possible.) Also if am I right, skript-mirror is another Skript addon. As I said, I want (possibly) Skript with no addons.

Any other ideas? :/
 
code_language.skript:
command /testukban:
    trigger:
        mehow ban player due to "test%newline%test"
Because you put in that you're banning yourself. You should add an argument
 
@TPGamesNL I meant that this
code_language.skript:
kick expression-1 due to "%expression-2%"
is doing ban function
[doublepost=1529780048,1529779736][/doublepost]@CustomWorldYT
code_language.skript:
ban player due to "text%newline%text"
or
code_language.skript:
function ban(p: player, r: text):
    kick {_p} due to {_r}
    set {bans::%{_p}%::reason} to {_r}

function unban(p: player):
    delete {bans::%{_p}%::*}
    send "unbanned" to {_p}
   
on join:
    if {bans::%player%::reason} is set:
        kick player due to {_r}
       
command /admin [<text>] [<player>] [<text>]:  
    trigger:
        if player is op:
            if arg-1 is "ban":
                arg-2 is set
                arg-3 is set
                ban(arg-2,arg-3)
            if arg-1 is "unban":
                arg-2 is set
                unban(arg-2)
 
@MeHow so how exactly I put multi lines in ban reason? Does this Skript require any addons? I'm Skript beginner and I don't know a lot about Skript stuff. I putted all code you gave me into a test skript, but it still doesn't work.

Currently, my ban command looks like following:
code_language.skript:
command /ban [<Offlineplayer>] [<Text>]:
    usage: /ban <Player> [<Reason>]
    trigger:
        if player's name is {@admins} or {@moderators} or {@owners} or {@co-owners} or {@helpers}:
            if arg 1 is set:
                if arg 2 is set:
                    set {banned.%arg 1%} to true
                    set {ban.time.%arg 1%} to now
                    set {ban.reason.%arg 1%} to argument-2
                    set {ban.bannedby.%arg 1%} to player
                    set {ban.expire.%arg 1%} to "Never"
                    set {BanIP.%arg 1%} to "False"
                    kick arg 1 due to "&c&lBanned! \n&cReason: &e%arg 2% %nl%&cBanned by: &e%player% %nl%&cExpiraion: &e&lNEVER %nl%&r %nl%&cUnban application at &e{@unban-app}"
                    ban arg 1 due to "&c&lBanned! %nl%&cReason: &e%arg 2% %nl%&cBanned by: &e%player% %nl%&cExpiraion: &e&lNEVER %nl%&r %nl%&cUnban application at &e{@unban-app}"
                    broadcast "&e%player% &cbanned &e%arg 1%"
                    broadcast "&cReason: &e%arg 2%"
                else:
                    send "{@Prefix} &cUsage: /Ban <Player> <Reason>"
            else:
                send "{@Prefix} &c/Ban <Player> <Reason>"
        else:
            send "{@no-perms}"
            stop
(I'm developing a FreeOP server mod, if you wonder why I don't use permissions.
Also, the "%nl%" and "\n% is a thingy I tested, so you can ignore it.)
 
%nl% or %newline% requires SkQuery. You will have to use that or SkUtlities
 
%nl% or %newline% requires SkQuery. You will have to use that or SkUtlities
I know it requires sk addons, I said it was thing I tested earlier so just ignore it.

It looks like multilined ban reasons cannot be used in Skript with no addons, and it looks like I gotta install some addons or just keep 1 lined ban messages.

You guys tired your best and showed me awesome codes, thank you very much. :emoji_grinning:
 
Status
Not open for further replies.