Discuss Scratch

Mozboz
Scratcher
1000+ posts

Creating a New Scratcher/signed out checker to the "Online Multiplayer" button in my game

Title says it all, how do I detect when a Scratcher can't use cloud variables?

RESOLVED! Thanks to everyone who helped out with this. MillionOfficial wrote actual code whereas the other's just helped in words, so that was a big help. Here's a quote of the post that contains the actual code:

MillionOfficial wrote:

set☁ new scratcher detectorto0change☁ new scratcher detectorby1ifnewscratcherdetector=0thennewscratchercodeelsescratchercode
If you're facing the same issue, try the above code written by MillionOfficial. I will now close the topic.

Last edited by Mozboz (Oct. 14, 2024 11:49:24)

GamesReinvented
New Scratcher
100+ posts

Creating a New Scratcher/signed out checker to the "Online Multiplayer" button in my game

If you have a cloud variable saved to for example “0” when saving the project, if you change it with code (without saving the project), for example if username = Mozboz change the variable by 1, the scratch servers will have it saved as one, but any signed out person/new scratcher opening the project will have it as 0, because scratch won't update due to them being a new scratcher.

Using this, you could have a simple script checking if the variable is equal to 0, and if it is they're a new scratcher.

For signed out people, you can easily check like so:
ifusername=thensayYou are a guest account!
RokCoder
Scratcher
1000+ posts

Creating a New Scratcher/signed out checker to the "Online Multiplayer" button in my game

This is a short project that detects whether a user is a Scratcher, New Scratcher or not logged in - basically what @GamesReinvented said above but with the additional check for someone not being logged in.

Last edited by RokCoder (Oct. 3, 2024 08:36:12)

MillionOfficial
Scratcher
500+ posts

Creating a New Scratcher/signed out checker to the "Online Multiplayer" button in my game

set☁ new scratcher detectorto0change☁ new scratcher detectorby1ifnewscratcherdetector=0thennewscratchercodeelsescratchercode
Mozboz
Scratcher
1000+ posts

Creating a New Scratcher/signed out checker to the "Online Multiplayer" button in my game

RESOLVED! Thanks to everyone who helped out with this. MillionOfficial wrote actual code whereas the other's just helped in words, so that was a big help. Here's a quote of the post that contains the actual code:

MillionOfficial wrote:

set☁ new scratcher detectorto0change☁ new scratcher detectorby1ifnewscratcherdetector=0thennewscratchercodeelsescratchercode
If you're facing the same issue, try the above code written by MillionOfficial. I will now close the topic.

Powered by DjangoBB