Command Interacting

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

Shroomz

Supporter +
Jun 22, 2017
44
0
6
25
I wanna create command that when you do ex. /ban then it tiggers message "Who you wanna ban?" and when you answer to that player name in chat it bans that user.

So basicly, how I make it listen my answer?
code_language.skript:
command /ban:
     trigger:
            message "Who would you like to ban:"
 
You could do something like:

code_language.skript:
command /ban:
    trigger:
        message "Who would you like to ban:"
        set {banPrompt::%player%} to true

on chat:
    {banPrompt::%player%} to true
    cancel event
    if ("%message% parsed as offline player") has not played before:
        message "&cThat player has never played before!"
    else:
        #ban player
        delete {banPrompt::%player%}

This is untested code, though.
 
You could do something like:

code_language.skript:
command /ban:
    trigger:
        message "Who would you like to ban:"
        set {banPrompt::%player%} to true

on chat:
    {banPrompt::%player%} to true
    cancel event
    if ("%message% parsed as offline player") has not played before:
        message "&cThat player has never played before!"
    else:
        #ban player
        delete {banPrompt::%player%}

This is untested code, though.
What addons that requires? Does not work...
 
What addons that requires? Does not work...
I had a quotation off in the original code; try this:

code_language.skript:
command /ban:
    trigger:
        message "Who would you like to ban:"
        set {banPrompt::%player%} to true
 
on chat:
    {banPrompt::%player%} is true
    cancel event
    if ("%message%" parsed as offline player) has not played before:
        message "&cThat player has never played before!"
    else:
        message "Player banned"
        delete {banPrompt::%player%}

I believe you'd only need Skript itself.
 
Status
Not open for further replies.