Someone please fix this /tempban 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 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!

Sulsayhl

Active Member
Mar 11, 2024
59
1
8
24
Its not working, I dont know why
Code:
command /tempban [<player>] [<timespan>] [<text>]:
    permission: tempban.mod.expadorsystem
    permission message: &cYou don't have access to this command!
    trigger:
        if arg 1 is not set:
            send "&cYou must specify a player name" to player
        if arg 2 is not a number:
            send "&cYou must specify a duration for the ban" to player
            stop
        if arg 3 is "":
            send "&cYou must specify a reason for the ban" to player
            stop
        ban arg 1 due to arg 3 for arg 2
        set {_bannedPlayer} to arg 1
        set {_duration} to arg 2
        set {_reason} to arg 3
        send "&aYou have succesfully &cTEMP-BANNED &e%arg 1% &afor &e%arg 2% &aand reason &e%arg 3%"
 
What's the problem? also don't make the arguments optional

Also timespans are formatted as "1 hour" and stuff like that, just make it a number argument and have it ban them for that many seconds.

Or make it a text with a number and then a letter (like h, m, s, w, mo, y) to decide how long it is
 
No, I can't.

This is skript-help, not skript-spoonfeeding.
I can, however, point you in the right direction. You can auto-replace "h" with "hour" and then parse it as a timespan or split the text at the number to grab the letter and the number separated.
 
I tried chaning it to number, that did not work.
and this is the command i did

/tempban test 1h Test

and that did not work