Solved Problem with a 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!

Status
Not open for further replies.

FEDX_sk

Member
Jul 25, 2017
14
0
0
Hi all, as per Title, I have a problem with this little skript that simply adds a variable every second ,but it doesn't work.

Code:
On join:
    set {Online.%player%} to "true"

every 1 second:
     loop all players:
         Loop-player's world is "{@world1}" and "{@world2}" and "{@world3}" and "{@world4}":
             if {Online.%player%} is "true":
               add "1" to {var.%loop-player%}

Thanks for help

Sorry for my bad english
 
Hi all, as per Title, I have a problem with this little skript that simply adds a variable every second ,but it doesn't work.

Code:
On join:
    set {Online.%player%} to "false"

every 1 second:
     loop all players:
         Loop-player's world is "{@world1}" and "{@world2}" and "{@world3}" and "{@world4}":
             if {Online.%player%} is "true":
               add "1" to {var.%loop-player%}

Thanks for help

Sorry for my bad english[/code]
Here try it like this maybe
code_language.skript:
every 1 second in world "world":
    loop all players:
        Loop-player's world is "{@world1}" or "{@world2}" or "{@world3}" or "{@world4}":
            if {Online.%player%} is "true":
                add 1 to {var.%loop-player%}
 
Here try it like this maybe
code_language.skript:
every 1 second in world "world":
    loop all players:
        Loop-player's world is "{@world1}" or "{@world2}" or "{@world3}" or "{@world4}":
            if {Online.%player%} is "true":
                add "1" to {var.%loop-player%}
for the second time, 1 should not be in quotes
 
also, doesnt {Online.%player%} need to be {Online.%loop-player%}?
I think so, so it'd be this rather.
code_language.skript:
every 1 second in world "world":
    loop all players:
        Loop-player's world is "{@world1}" or "{@world2}" or "{@world3}" or "{@world4}":
            if {Online.%loop-player%} is "true":
                add 1 to {var.%loop-player%}

The only thing I'm not sure of is if he'd need to do a periodical in each world or if in world "world" covers it.
 
I think so, so it'd be this rather.
code_language.skript:
every 1 second in world "world":
    loop all players:
        Loop-player's world is "{@world1}" or "{@world2}" or "{@world3}" or "{@world4}":
            if {Online.%loop-player%} is "true":
                add 1 to {var.%loop-player%}

The only thing I'm not sure of is if he'd need to do a periodical in each world or if in world "world" covers it.
just dont specify a world?
 
I have tested the code but he give me a error

Code:
 [Skript] can't understand this event: 'every 1 second in world "world"' (test.sk, line 10: every 1 second in world "world":')
 
I have tested the code but he give me a error

Code:
 [Skript] can't understand this event: 'every 1 second in world "world"' (test.sk, line 10: every 1 second in world "world":')
it turns out you don't need the world "world" bit. try it without that.:emoji_slight_smile: I was under the impression it was required before.
 
you could also use a where filter here which according to pikachu is better for some reason i forget
code_language.skript:
every second:
    loop all players where [{Online.%player input%} is true]:
        if loop-player's world is "{@world1}" or "{@world2}" or "{@world3}" or "{@world4}":
            add 1 to {var.%loop-player%}
idk if its possible to put both conditions in the where filter. if it is idk how to
 
The console give me a error from code of Donut:
Code:
 Can't understand this loop: 'loop all players where [{Online.%player input%} is true]' (test.sk, line 11: loop all players where [{Online.%player input%} is true]:')

Edit: i have tested the code from Wynnevir and it working.

Thank all for help
 
Last edited by a moderator:
Status
Not open for further replies.