• Hey! Register here to create your account, engage with the community, and talk about what is new!

How would I create a plot loop?

SquareFinder

New member
Joined
Jul 8, 2022
Messages
12
Reaction score
2
What I mean is like a loop in a process, but that process cannot have multiple instances of itself running at the same time. For example if you have a minigame a process that loops to organise when the game can start, and the timer, etc.

What I've done right now, (doesn't work) is to have a game variable that sets to 1 when someone joins, and starts the process with no targets. However, it seems it still is activating for all people who join.
 
Last edited:

CNK_

New member
Overlord
Joined
Oct 3, 2021
Messages
14
Reaction score
10
The game vaule player count is likely the game value your looking for.
The easiest way as far as I know on how to do that is to test if the Player Count (Which is a game value in plots values.) is equal to 1. Then run your process with no targets. There is a slight issue with this method because if /play is ran quick enough the process can be ran twice. To prevent this just don't allow /play.


What I've done right now, (doesn't work) is to have a game variable that sets to 1 when someone joins, and starts the process with no targets. However, it seems it still is activating for all people who join.
This ^^^ also should have worked. Did variable you used have %default in it or anything that would make it unqiue to the player? You acidently set it to 0 somewhere? What you can do is assuming they are the first player do If Variable Exsits [Var(GAME)] and then set it to anything inside of the condition. Also keep in mind that any variable that hasn't been used yets vlaue is equal to 0.

Note: This is all assuming you are running it off of the player join event.
 

Orrinpants

New member
Joined
May 22, 2022
Messages
5
Reaction score
1
Code:
...If variable [(Game Value: Player Count) = 1] {
Start process: "Game Loop"
}...

Process "Game Loop": Call function: "Game Loop"
 

SquareFinder

New member
Joined
Jul 8, 2022
Messages
12
Reaction score
2
View attachment 1486
The easiest way as far as I know on how to do that is to test if the Player Count (Which is a game value in plots values.) is equal to 1. Then run your process with no targets. There is a slight issue with this method because if /play is ran quick enough the process can be ran twice. To prevent this just don't allow /play.



This ^^^ also should have worked. Did variable you used have %default in it or anything that would make it unqiue to the player? You acidently set it to 0 somewhere? What you can do is assuming they are the first player do If Variable Exsits [Var(GAME)] and then set it to anything inside of the condition. Also keep in mind that any variable that hasn't been used yets vlaue is equal to 0.

Note: This is all assuming you are running it off of the player join event.
Thank you, I think although I did a comparison for if the variable equals 0, I should actually do the if variable exists (forgot that existed, i once saw it somewhere i think). I will try that, I don't particularly like doing the player count method, since if two players join in the same tick, it may bug out.
 
Top Bottom