Discuss Scratch

ChickenYumSoup
Scratcher
70 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

im making a chat AI And stuff, i need help, when i start the project it add the user, but just ONLY that user who is playing,
i want to know how to make like a mechanic that shows who are the people have visited.
when i restart it by clicking green flag again it adds a duplicate me,
how do i fix this?
heres the project
https://scratch.mit.edu/projects/774977726/
RosNotRoss
Scratcher
14 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

I reccomended running an if then block, kind of like
foreverifusernamethennothing

So you do not count the same user twice, and no code will go as a result, with the code listed you would also need a “if username not = database” so new users could register. That means you could make a user database in your variables that way when they click the green start flag, they are in the database and can’t be counted using the same code, and maybe try making a save code for that specific user.

The whole process would look like this, but not exactly after you make a list named anything you want:

whenclickedforeverifusername=listthenloadsavedataelseaddusernametolist

Last edited by RosNotRoss (Dec. 10, 2022 04:58:11)

ChickenYumSoup
Scratcher
70 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

im confused about the coding thingy u typed
RosNotRoss
Scratcher
14 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

ChickenYumSoup wrote:

im confused about the coding thingy u typed
Let me try explaining it again but easier to understand, I only know the user identification process. So when you press start you’re going to want to use one of these blocks to combine it,
whenclickedforever

After that, you’re going to want to add an if then block, this will make the user detection identify your user once you press flag, before we get in all the code, so it combined would look like, the forever is so it’s always keeping track:
whenclickedforeverifthenelse

Now, you add in the other stuff, to make it look like

whenclickedforeverifusername=listthenelseaddusernametolist

To make the list store stuff on the servers you will have to make the save data with cloud variables. I recommended looking at projects with cloud save to help you with the conversion. I hope this helped you!

Last edited by RosNotRoss (Dec. 10, 2022 05:23:27)

ChickenYumSoup
Scratcher
70 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

when i tried it it dont work help-
im confused if i did it wrong
welp
time to add another engine that re-uses
the players logged in for ur username
time to actually make it just a chatbot-
RosNotRoss
Scratcher
14 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

ChickenYumSoup wrote:

when i tried it it dont work help-
im confused if i did it wrong
welp
time to add another engine that re-uses
the players logged in for ur username
time to actually make it just a chatbot-
I’m not the best with cloud variables, I’m very sorry for not explaining it the best.
Vectations
Scratcher
2 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

hurm
ChickenYumSoup
Scratcher
70 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

RosNotRoss wrote:

ChickenYumSoup wrote:

when i tried it it dont work help-
im confused if i did it wrong
welp
time to add another engine that re-uses
the players logged in for ur username
time to actually make it just a chatbot-
I’m not the best with cloud variables, I’m very sorry for not explaining it the best.
nah its ok
huboojoe
Scratcher
100+ posts

how do i remove duplicate players? (and also how to save players in players logged in?)

ChickenYumSoup wrote:

RosNotRoss wrote:

ChickenYumSoup wrote:

when i tried it it dont work help-
im confused if i did it wrong
welp
time to add another engine that re-uses
the players logged in for ur username
time to actually make it just a chatbot-
I’m not the best with cloud variables, I’m very sorry for not explaining it the best.
nah its ok
Actually, cloud variables are frozen recently
ChickenYumSoup
Scratcher
70 posts

how do i remove duplicate players? (and also how to save players in players logged in?)

huboojoe wrote:

ChickenYumSoup wrote:

RosNotRoss wrote:

ChickenYumSoup wrote:

when i tried it it dont work help-
im confused if i did it wrong
welp
time to add another engine that re-uses
the players logged in for ur username
time to actually make it just a chatbot-
I’m not the best with cloud variables, I’m very sorry for not explaining it the best.
nah its ok
Actually, cloud variables are frozen recently
wdym?

Powered by DjangoBB