Solved loop players

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

xCoini

Member
Apr 19, 2019
14
0
0
18
Yes I know, there must be an item-type but I do not know how else to do it:

Code:
every second:
    loop all players:
        if %loop-player% has permission "system.mod":
            set {Mod.%player%} to true
 
As said @novastosha . The percentages are only used in texts or things like that, if it is not a text, do not put percentages. Besides, you were wrong in the last line.

code_language.skript:
every second:
    loop all players:
        if loop-player has permission "system.mod":
            set {Mod.%loop-player%} to true
In your code you wrote {Mod.%player%}, when that variable was inside a loop.

Finally, if you are going to use percentages, make sure you write the quotes before:
code_language.skript:
#with quotes
every second:
    loop all players:
        if "%loop-player%" has permission "system.mod":
            set {Mod.%loop-player%} to true

#without quotes
every second:
    loop all players:
        if loop-player has permission "system.mod":
            set {Mod.%loop-player%} to true
 
As said @novastosha . The percentages are only used in texts or things like that, if it is not a text, do not put percentages. Besides, you were wrong in the last line.

code_language.skript:
every second:
    loop all players:
        if loop-player has permission "system.mod":
            set {Mod.%loop-player%} to true
In your code you wrote {Mod.%player%}, when that variable was inside a loop.

Finally, if you are going to use percentages, make sure you write the quotes before:
code_language.skript:
#with quotes
every second:
    loop all players:
        if "%loop-player%" has permission "system.mod":
            set {Mod.%loop-player%} to true

#without quotes
every second:
    loop all players:
        if loop-player has permission "system.mod":
            set {Mod.%loop-player%} to true
I am stupid, i didin't see that his used %player% while looping all players
 
Status
Not open for further replies.