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.

False Positive

Discussion in 'Skript' started by toriset, Oct 30, 2020.

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

    toriset Member

    Joined:
    Jan 9, 2020
    Messages:
    2
    Likes Received:
    0
    Skript Version:
    2.5.1

    Minecraft Version:
    1.16.3

    Full Code:

    command /Create [<text>]:
    aliases: host
    cooldown: 15 seconds
    cooldown message: &3&lCrystal &8» &7You are now on cooldown for /create
    trigger:
    if {HostedServers::*} does not contain arg 1:
    set {_l} to length of arg 1
    if {_l} > 16:
    send "&cYou are passing the server name limit by &b%{_l} - 10%"
    stop
    if arg 1 is set:
    set {_c} to arg 1
    loop {allowed.characters::*}:
    set {_l} to loop-value
    loop 16 times:
    replace "%{_l}%" with "" in {_c}
    if {_c} is not "":
    send "&3&lCrystal &8» &cInvalid characters"
    stop
    else:
    if {Server.1.%player%} is not set:
    set {Creating} to true
    send "&3&lCrystal &8» &7Creating Started..."
    make console execute "mvclone FlatTemplate %arg 1%"

    wait 3 ticks

    send "&3&lCrystal &8» &7Setting up server."
    wait 25 ticks
    set {Server.1.%player%} to true
    set {ServerName.1.%player%} to arg 1


    send "&3&lCrystal &8» &7Starting up server."
    wait 13 ticks

    send "&3&lCrystal &8» &7Getting done."
    add arg 1 to {HostedServers::*}

    send "&3&lCrystal &8» &7Server finished!"
    add arg 1 to {OnlineServers::*}
    set {Creating} to false
    else if {Server.1.%player%} is set:
    if {Server.2.%player%} is not set:
    set {Creating} to true
    send "&3&lCrystal &8» &7Creating Started..."

    make console execute "mvclone FlatTemplate %arg 1%"
    wait 3 ticks

    send "&3&lCrystal &8» &7Setting up server."
    wait 25 ticks
    set {Server.2.%player%} to true
    set {ServerName.2.%player%} to arg 1

    send "&3&lCrystal &8» &7Accepting EULA."
    wait 15 ticks

    send "&3&lCrystal &8» &7Getting done."
    add arg 1 to {HostedServers::*}

    send "&3&lCrystal &8» &7Server finished!"
    add arg 1 to {OnlineServers::*}
    set {Creating} to false
    else:
    if {Server.3.%player%} is not set:
    set {Creating} to true
    send "&3&lCrystal &8» &7Creating Started..."
    make console execute "mvclone FlatTemplate %arg 1%"

    wait 3 ticks

    send "&3&lCrystal &8» &7Setting up server."
    wait 25 ticks
    set {Server.3.%player%} to true
    set {ServerName.3.%player%} to arg 1

    send "&3&lCrystal &8» &7Accepting EULA."
    wait 15 ticks

    send "&3&lCrystal &8» &7Getting done."
    add arg 1 to {HostedServers::*}

    send "&3&lCrystal &8» &7Server finished!"
    add arg 1 to {OnlineServers::*}
    set {Creating} to false

    else:
    send "&3&lCrystal &8» &cSorry, but you have no more server slots left."
    stop
    add arg 1 to {UserServers::%sender%}
    set {ServerOwner.%arg 1%} to name of sender
    add name of sender to {SavedUsers::*}
    set {ServerVersion.%arg 1%} to "PaperSpigot"
    add arg 1 to {HostedServers::*}
    else:
    send "&3&lCrystal &8» &cSorry, but that server name is already taken.

    Errors on Reload:
    No errors

    Console Errors:
    None

    Other Useful Info:
    When i try to do /create test123, it sais that it has invalid characters but it definetly does not.

    Have you tried searching the docs?
    Yes i have but i did not find anything usefull

    Have you tried searching the Forums?
    Yes, thats exactly how i found the way to detect invalid chars.
    --- Double Post Merged, Oct 30, 2020, Original Post Date: Oct 30, 2020 ---
    I dont know how to put code skript thing
     
Thread Status:
Not open for further replies.

Share This Page

Loading...