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

how to run code only once

Wirisu

New member
Joined
Nov 11, 2022
Messages
2
Reaction score
1
I have a process. I want this process to be run when the first player joins, but I can't figure out how. Every time a player joins, the process is run, and I don't want that to happen. I'm a big noob mostly and I know this is pretty basic knowledge.
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,226
Reaction score
347
On Player Join Event, place an If Variable = block, we will use it to check if the Player Count is 1 which then will run the process
1668162906106.png
and now for it's arguments, in the first slot put a Game Value: Player Count
1668162978919.png that will give us the current player count on the plot

and in the 2nd slot, put a Number 1 , that will now only run when the first player joins the plot and for the start process thing, don't forget to change the target of the process to No Targets so the process doesn't stop when that player leaves1668163075058.png (Select the 3rd option in the Target Mode)
 

ARMcPro

Forum adept
Overlord
Joined
Oct 20, 2020
Messages
1,226
Reaction score
347
(I got these pictures from the DiamondFire discord server, you should join it because you will get much faster support in there)
 
Top Bottom