Skript Placeholder Issue

Discussion in 'Skript' started by Engineous, Jan 11, 2020.

Thread Status:
Not open for further replies.
  1. Hello I am writing a Skript report thing and it is incorrectly correcting correct things. I have made it so the Skript does not allow you to report yourself, but for some reason say my username is Engineous and I type in Eng it still cancels it because it thinks it's my username. Does anyone know how to fix this? Here is my code:
    Code (Text):
    command /report [<player>] [<text>]:
        executable by: players
            set {_waited} to difference between {report.%player%.lastused} and now
            if {_waited} is less than 3 seconds:
                message "&cYou need to wait 1 minute before making another report!"
            if arg-1 is "%player%":
                send "&cYou can't report yourself!"
            if arg-1 is not set:
                send "&cUsage: /report <player> <reason>" to player
                stop trigger
            if arg-2 is not set:
                send "&cUsage: /report <player> <reason>" to player
                stop trigger
            if arg-2 is "Hacking":
                add 1 to {%arg-1%.reportcount}
                send "&aYou've reported %arg-1% for Hacking"
                loop all players:
                    loop-player has permission "reports.view"
                    send "&3[S] &b%arg-1% &7(%{%arg-1%.reportcount}%) &7reported by &b%player%" to loop-player
                    set {report.%player%.lastused} to now
                send "&cThat is not a reason" to player
                stop trigger
    Solved: Don't use Skript
    #1 Engineous, Jan 11, 2020
    Last edited: Sep 16, 2020
  2. it happens because you are using <player>, use <text> instead if you want it to not auto-correct, if you want to get player object out of text, you can do set {_player} to arg 1 parsed as a player

    also it is much better to use list variables, such as {variable::%uuid of player%} than {variable.%player%}, because they are much easier to manage, you can do various useful actions with them, like:
    Code (Text):

      set {variable::italy} to "&9Dream of Italy"
      set {variable::egypt} to "&ePyramid of Egypt"

      send "List of maps:"
      loop {variable::*}:
        send "%loop-value%"
      send "There are %amount of {variable::*}% maps in this game."

      set {variable::*} to all players in radius 10 of player
      teleport {variable::*} to location of player
      give a diamond to {variable::*}

      loop {variable::*}:
        if loop-value is offline:
          delete {variable::%loop-index%}

      teleport {variable::*} to spawn point of world ("world" parsed as a world)
      send "Game has started!" to {variable::*}

      kill {variable::*}
      delete {variable::*}
    even if you do not need that kind of functionality, there is no point in not using list variables, just in case if you will ever need it. List variables are absolutely superior to dot variables.
Thread Status:
Not open for further replies.