Discuss Scratch

coooolboy55
Scratcher
56 posts

how do you make a players online counter?

IMAhomosapien wrote:

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
coooolboy55
Scratcher
56 posts

how do you make a players online counter?

IMAhomosapien wrote:

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
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
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]
TeamNITE_gaming
Scratcher
9 posts

how do you make a players online counter?

thx!
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))
change [player active v] by (-1)
I hope this might help!

Last edited by Blazing_Codes (May 18, 2024 15:32:16)

leviawesomecoder
Scratcher
6 posts

how do you make a players online counter?

I noticed.

Powered by DjangoBB