if {variable} is greater than 1 problem

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

WorldMoney

Member
Mar 29, 2020
14
0
0
23
Hi, i have a Script. And this is a Minigame, at 2 Players the Game starts but if i do {the variable} is greater than 1: in the skript then in Minecraft comes an Error: Cant understand this event: if {count.player.ampelrennen} greater than 1' Ampelrennen.sk Line 77: Remove etc. Here's the Skript:

Code:
if {count.player.ampelrennen} is greater than 1:
    send "In 30 Sekunden startet das Spiel." to player
    wait 15 seconds
    send "In 15 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 10 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 5 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 4 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 3 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 2 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 1 Sekunden startet das Spiel." to player
    wait 1 second
    send "Jetzt wird das Spiel starten." to player

Pls can anyone help?
 
Hi, i have a Script. And this is a Minigame, at 2 Players the Game starts but if i do {the variable} is greater than 1: in the skript then in Minecraft comes an Error: Cant understand this event: if {count.player.ampelrennen} greater than 1' Ampelrennen.sk Line 77: Remove etc. Here's the Skript:

Code:
if {count.player.ampelrennen} is greater than 1:
    send "In 30 Sekunden startet das Spiel." to player
    wait 15 seconds
    send "In 15 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 10 Sekunden startet das Spiel." to player
    wait 5 seconds
    send "In 5 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 4 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 3 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 2 Sekunden startet das Spiel." to player
    wait 1 second
    send "In 1 Sekunden startet das Spiel." to player
    wait 1 second
    send "Jetzt wird das Spiel starten." to player

Pls can anyone help?
I recommend you use
code_language.skript:
if {variable} > 1
instead of
code_language.skript:
if {variable} is greater than 1
Regarding your problem, what version of skript do you have?
 
It doesent work with if {variable} > 1 and i dont know the version xd Here stand: You are running a custom version of Skript No updates will be installed
 
So here do it add:
Code:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add sender to {ampelrennen.%player%}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
        if arg 1 is "leave":
            if {join.%player%} is "1":
                remove 1 from {count.player.ampelrennen}
                remove sender from {ampelrennen.spieler}
                set {join.%player%} to "0"
                teleport player to {spawn.leave}
                send "{@LEAVEMESSAGE}" to player
            else if {join.%player%} is "0":
                send "{@INKEINSPIELERRORMESSAGE}"
 
So here do it add:
Code:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add sender to {ampelrennen.%player%}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
        if arg 1 is "leave":
            if {join.%player%} is "1":
                remove 1 from {count.player.ampelrennen}
                remove sender from {ampelrennen.spieler}
                set {join.%player%} to "0"
                teleport player to {spawn.leave}
                send "{@LEAVEMESSAGE}" to player
            else if {join.%player%} is "0":
                send "{@INKEINSPIELERRORMESSAGE}"
Are you sure you wrote the code correctly? I mean:


Hi, i have a Script. And this is a Minigame, at 2 Players the Game starts but if i do {the variable} is greater than 1: in the skript then in Minecraft comes an Error: Cant understand this event: if {count.player.ampelrennen} greater than 1' Ampelrennen.sk Line 77: Remove etc. Here's the Skript:
Here you said that skript sent you this error: "Cant understand this event: if{count.player.ampelrennen} greater than 1". I don't know if [is] is optional or mandatory for skript to recognize the line of code.
 
It is mandatory because at 2 Player starts the game?! I think I don't quite understand what you mean?!
 
So here do it add:
Code:
        if arg 1 is "join":
            if {join.%player%} is "0":
                set {join.%player%} to "1"
                teleport player to {spawn.lobby}
                add sender to {ampelrennen.%player%}
                add 1 to {count.player.ampelrennen}
                send "{@JOINMESSAGE}" to player
            else if {join.%player%} is "1":
                send "{@BEREITSIMSPIELMESSAGE}" to player
        if arg 1 is "leave":
            if {join.%player%} is "1":
                remove 1 from {count.player.ampelrennen}
                remove sender from {ampelrennen.spieler}
                set {join.%player%} to "0"
                teleport player to {spawn.leave}
                send "{@LEAVEMESSAGE}" to player
            else if {join.%player%} is "0":
                send "{@INKEINSPIELERRORMESSAGE}"
Also, remember for a variable to be set to a player, use the %player% inside the variable. If that was your intention here:


So here do it add:
Code:
add 1 to {count.player.ampelrennen}
to
code_language.skript:
 add 1 to {count.%player%.ampelrennen}
 
No, because otherwise every number is saved for each player, but this is the variable that shows how many players are in the game. If% player% is in there it is most 1 but it should count in total...
 
No, because otherwise every number is saved for each player, but this is the variable that shows how many players are in the game. If% player% is in there it is most 1 but it should count in total...
Ohh, i understand. Well, I have thought about the matter and I have not been able to decipher why it gives you an error. It may have to do with the version of the skript or something like that.
 
Status
Not open for further replies.