Solved wrong usage help

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

Adrihun

Member
Feb 1, 2017
368
6
0
I have a basic invsee skript. So when a player types in /invsee [name] it will show them a gui of the selected players inventory.

When the player is offline, skript says the player is offline. But then, it says wrong usage. How can i remove the "wrong usage" text.

Here is my script:
code_language.skript:
command /invsee [<player>]:
usage: &7Wrong usage
permission: invsee.player
permission message: &8&lNo permission!
trigger:
if arg-1 is not set:
send "&7Wrong usage"
else:
open the arg 1's inventory for the player
[doublepost=1487203451,1487200676][/doublepost]bump
 
I have a basic invsee skript. So when a player types in /invsee [name] it will show them a gui of the selected players inventory.

When the player is offline, skript says the player is offline. But then, it says wrong usage. How can i remove the "wrong usage" text.

Here is my script:
code_language.skript:
command /invsee [<player>]:
    usage: &7Wrong usage
    permission: invsee.player
    permission message: &8&lNo permission!
    trigger:
        if arg-1 is not set:
            send "&7Wrong usage"
        else:
            open the arg 1's inventory for the player
[doublepost=1487203451,1487200676][/doublepost]bump
Bump every 24 hours only.
Remove
Code:
usage: &7Wrong usage
from your command, and I'm sure it'll be fixed.
 
Bump every 24 hours only.
Remove
Code:
usage: &7Wrong usage
from your command, and I'm sure it'll be fixed.
thanks
[doublepost=1487256676,1487207194][/doublepost]
Bump every 24 hours only.
Remove
Code:
usage: &7Wrong usage
from your command, and I'm sure it'll be fixed.
hm.. still not working, btw i edited the messages inside the Skript.jar in the lang folder. I even removed the text from "usage:" and "correct usage:" and in game, it now says something like correct.usage (in white). So i decided to put it back to normal.
 
thanks man!
you are a legend. I had this problem for months now and i have been thinking about quitting server making cus of this. Thank you soo soo much!

I have some other scripts (2-3) that also have this problem, it would be really nice if you could fix them aswell :emoji_slight_smile:

Message me if you want to fix them - they are simple scripts
[doublepost=1487283546,1487281752][/doublepost]
bump
please message me back
@fwet
 
just tell us your problem.
here is my other script that needs to be fixed so it will say "this player is offline"
code_language.skript:
command /pm [<player>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 2 is set:
                if player is set:
                    send "&9From &7%player% &f%arg 2%" to arg 1
                    send "&9To &7%arg 1% &f%arg 2%"
 
here is my other script that needs to be fixed so it will say "this player is offline"
code_language.skript:
command /pm [<player>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 2 is set:
                if player is set:
                    send "&9From &7%player% &f%arg 2%" to arg 1
                    send "&9To &7%arg 1% &f%arg 2%"

code_language.skript:
command /pm [<player>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 2 is set:
                send "&9From &7%player% &f%arg 2%" to arg 1
                send "&9To &7%arg 1% &f%arg 2%"
 
code_language.skript:
command /pm [<player>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 2 is set:
                send "&9From &7%player% &f%arg 2%" to arg 1
                send "&9To &7%arg 1% &f%arg 2%"
Uhm, what did you change exactly?
 
ok but why?
i need fix for the script because if you type in an offline player it will say "&cError &7Please write player name and message. "
I want it to say "&cError &7Player offline "
Try this? (Haven't tested yet.)
Code:
command /pm [<player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 1 is offline:
                send "&cError &7%arg 1% is offline."
            if arg 1 is online:
                if arg 2 is set:
                    send "&9From &7%player% &f%arg 2%" to arg 1
                    send "&9To &7%arg 1% &f%arg 2%"
 
Try this? (Haven't tested yet.)
Code:
command /pm [<player>] [<text>]:
    trigger:
        if arg 1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 1 is offline:
                send "&cError &7%arg 1% is offline."
            if arg 1 is online:
                if arg 2 is set:
                    send "&9From &7%player% &f%arg 2%" to arg 1
                    send "&9To &7%arg 1% &f%arg 2%"
not working.
[doublepost=1487296608,1487296543][/doublepost]bump

need help with this skript
code_language.skript:
command /pm [<player>] [<text>]:
    trigger:
        if arg-1 is not set:
            send "&cError &7Please write player name and message. "
        if arg 1 is set:
            if arg 2 is set:
                if player is set:
                    send "&9From &7%player% &f%arg 2%" to arg 1
                    send "&9To &7%arg 1% &f%arg 2%"

So it says "Offline player" if the player is offline.
Right now it is saying " send "&cError &7Please write player name and message. " " if the player is offline
 
code_language.skript:
function removeColors(text: text, player: player) :: text:

    set {_colors::*} to integers from 0 to 9 and split "abcdefonmrkl" by ""

    set {_text::*} to {_text} split by ""

    loop {_colors::*}:

        if {_text} contains "&%loop-value%":

            {_player} doesn't have permission "pm.color.&%loop-value%" or "pm.color.all"

            loop {_text::*}:

                loop-value-2 = "&"

                {_text::%loop-index-2 parsed as int + 1%} = "%loop-value-1%"

                delete {_text::%loop-index-2%}

                delete {_text::%loop-index-2 parsed as int + 1%}

        set {_text} to join {_text::*} by ""

    return colored {_text}

command /pm [<offlineplayer>] [<text>]:
      trigger:
            if arg-2 is set:
                  if arg-1 is online:
                        send "&9From &7%sender's display name% &f%removeColors(arg-2)%" to arg-1
                        send "&9To &7%arg-1's display name% &f%removeColors(arg-2)%"
                        stop
                  send "&4Error &cThe player &7%arg-1% &cis offline."
                  stop
            send "&4Error &cPlease write the player name and message."
 
Last edited by a moderator:
Status
Not open for further replies.