Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do you make a players online counter?
- coooolboy55
- Scratcher
56 posts
how do you make a players online counter?
when green flag clicked
change(☁ players)by (1)
[/quote]
if we press the green flag more than one time it will glitch
also if you press the stop sign it wont remove anything
BreakInfinity engine (used for incrementals): https://scratch.mit.edu/projects/979385550/
Use this for platformers: https://scratch.mit.edu/projects/958808113/
My best games: https://scratch.mit.edu/projects/1011997463 https://scratch.mit.edu/projects/920185568/
Name generator: https://scratch.mit.edu/projects/582581311/
- coooolboy55
- Scratcher
56 posts
how do you make a players online counter?
when green flag clicked
change(☁ players)by (1)
if we press the green flag more than one time it will glitch
also if you press the stop sign it wont remove anything
BreakInfinity engine (used for incrementals): https://scratch.mit.edu/projects/979385550/
Use this for platformers: https://scratch.mit.edu/projects/958808113/
My best games: https://scratch.mit.edu/projects/1011997463 https://scratch.mit.edu/projects/920185568/
Name generator: https://scratch.mit.edu/projects/582581311/
- TeamNITE_gaming
- Scratcher
9 posts
how do you make a players online counter?
could you use the scratch blocks to re do that cde plz. I need code 2!
- homewins
- Scratcher
45 posts
how do you make a players online counter?
The basic concept is set the PLAYERS variable to 0 and go through a loop, checking if each player is active. If so, you can change PLAYERS by 1.
There is probably a variable called “active” or something like that in each player clone that tells you if that player is active. If this is the case, just have a different sprite set PLAYERS to 0 and then add an
There is probably a variable called “active” or something like that in each player clone that tells you if that player is active. If this is the case, just have a different sprite set PLAYERS to 0 and then add an
if <[active] > [0]> then //assumes "active" variable is greater than 0 when the player is active
change [PLAYERS v] by (1)
end
//in a different sprite that runs its code before the "Cloud players" sprite:
set [PLAYERS v] to [0]
- tigeralaunch
- Scratcher
3 posts
how do you make a players online counter?
maybe we can use the “current second” operator and always refresh the player count every second?
- Calvin9901
- Scratcher
1 post
how do you make a players online counter?
when I start as a clone
delete this clone
delete this clone
- ducky_boy010
- Scratcher
1 post
how do you make a players online counter?
make (bacon)
Last edited by ducky_boy010 (May 14, 2024 05:45:11)
- Blazing_Codes
- Scratcher
37 posts
how do you make a players online counter?
when green flag clicked
change [player active v] by (1)
forever
set [.timer v] to (timer)
end
when [timer v] > ((.timer v) + (0.01))I hope this might help!
change [player active v] by (-1)
Last edited by Blazing_Codes (May 18, 2024 15:32:16)
- Discussion Forums
- » Help with Scripts
- » how do you make a players online counter?