1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Skript help - Multilined ban reason messages

Discussion in 'Skript' started by CustomWorldYT, Jun 23, 2018.

Thread Status:
Not open for further replies.
  1. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    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 (Skript):
    1.  
    2. command /ban <player>:
    3.     ban arg 1 due to "Banned! \n (?) Reason... blah blah blah"
    4.  
    Errors on Reload:

    Code (Skript):
    1. None.
    Console Errors:

    Code (Skript):
    1. 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
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    If you have SkQuery, you can use %nl%
     
    • Useful Useful x 2
  3. MeHow

    MeHow Active Member

    Joined:
    Feb 6, 2017
    Messages:
    140
    Likes Received:
    13
    You have to do ban syntax by your self. Use Skript-mirror or move your post to request section.

    For new line use
    Code (Skript):
    1.  %newline%
    --- Double Post Merged, Jun 23, 2018, Original Post Date: Jun 23, 2018 ---
    Code (Skript):
    1. effect [mehow] ban %player% due to %string%:
    2.     trigger:
    3.         kick expression-1 due to "%expression-2%"
    Dunno how, but then I use this syntax I get banned :emoji_grinning:
     
    • Informative Informative x 2
  4. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    What's the code where you call the effect?
     
    • Like Like x 1
  5. MeHow

    MeHow Active Member

    Joined:
    Feb 6, 2017
    Messages:
    140
    Likes Received:
    13
    Code (Skript):
    1. command /testukban:
    2.     trigger:
    3.         mehow ban player due to "test%newline%test"
     
    • Informative Informative x 1
  6. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    0
    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? :/
     
  7. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    Because you put in that you're banning yourself. You should add an argument
     
    • Informative Informative x 1
  8. MeHow

    MeHow Active Member

    Joined:
    Feb 6, 2017
    Messages:
    140
    Likes Received:
    13
    @TPGamesNL I meant that this
    Code (Skript):
    1. kick expression-1 due to "%expression-2%"
    is doing ban function
    --- Double Post Merged, Jun 23, 2018, Original Post Date: Jun 23, 2018 ---
    @CustomWorldYT
    Code (Skript):
    1. ban player due to "text%newline%text"
    or
    Code (Skript):
    1. function ban(p: player, r: text):
    2.     kick {_p} due to {_r}
    3.     set {bans::%{_p}%::reason} to {_r}
    4.  
    5. function unban(p: player):
    6.     delete {bans::%{_p}%::*}
    7.     send "unbanned" to {_p}
    8.    
    9. on join:
    10.     if {bans::%player%::reason} is set:
    11.         kick player due to {_r}
    12.        
    13. command /admin [<text>] [<player>] [<text>]:  
    14.     trigger:
    15.         if player is op:
    16.             if arg-1 is "ban":
    17.                 arg-2 is set
    18.                 arg-3 is set
    19.                 ban(arg-2,arg-3)
    20.             if arg-1 is "unban":
    21.                 arg-2 is set
    22.                 unban(arg-2)    
     
    • Useful Useful x 1
  9. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    0
    @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 (Skript):
    1.  
    2. command /ban [<Offlineplayer>] [<Text>]:
    3.     usage: /ban <Player> [<Reason>]
    4.     trigger:
    5.         if player's name is {@admins} or {@moderators} or {@owners} or {@co-owners} or {@helpers}:
    6.             if arg 1 is set:
    7.                 if arg 2 is set:
    8.                     set {banned.%arg 1%} to true
    9.                     set {ban.time.%arg 1%} to now
    10.                     set {ban.reason.%arg 1%} to argument-2
    11.                     set {ban.bannedby.%arg 1%} to player
    12.                     set {ban.expire.%arg 1%} to "Never"
    13.                     set {BanIP.%arg 1%} to "False"
    14.                     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}"
    15.                     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}"
    16.                     broadcast "&e%player% &cbanned &e%arg 1%"
    17.                     broadcast "&cReason: &e%arg 2%"
    18.                 else:
    19.                     send "{@Prefix} &cUsage: /Ban <Player> <Reason>"
    20.             else:
    21.                 send "{@Prefix} &c/Ban <Player> <Reason>"
    22.         else:
    23.             send "{@no-perms}"
    24.             stop    
    25.  
    (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.)
     
  10. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,501
    Likes Received:
    107
    Medals:
    %nl% or %newline% requires SkQuery. You will have to use that or SkUtlities
     
    • Informative Informative x 1
  11. CustomWorldYT

    CustomWorldYT Member

    Joined:
    Jun 17, 2018
    Messages:
    15
    Likes Received:
    0
    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:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...