Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » how do i remove duplicate players? (and also how to save players in players logged in?)
- ChickenYumSoup
-
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/
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
-
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
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:
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:
Last edited by RosNotRoss (Dec. 10, 2022 04:58:11)
- ChickenYumSoup
-
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
-
14 posts
how do i remove duplicate players? (and also how to save players in players logged in?)
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, im confused about the coding thingy u typed
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:
Now, you add in the other stuff, to make it look like
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
-
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-
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
-
14 posts
how do i remove duplicate players? (and also how to save players in players logged in?)
I’m not the best with cloud variables, I’m very sorry for not explaining it the best. 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-
- Vectations
-
2 posts
how do i remove duplicate players? (and also how to save players in players logged in?)
hurm
- ChickenYumSoup
-
70 posts
how do i remove duplicate players? (and also how to save players in players logged in?)
nah its okI’m not the best with cloud variables, I’m very sorry for not explaining it the best. 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-
- huboojoe
-
100+ posts
how do i remove duplicate players? (and also how to save players in players logged in?)
Actually, cloud variables are frozen recentlynah its okI’m not the best with cloud variables, I’m very sorry for not explaining it the best. 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-
- ChickenYumSoup
-
70 posts
how do i remove duplicate players? (and also how to save players in players logged in?)
wdym?Actually, cloud variables are frozen recentlynah its okI’m not the best with cloud variables, I’m very sorry for not explaining it the best. 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-
- Discussion Forums
- » Help with Scripts
-
» how do i remove duplicate players? (and also how to save players in players logged in?)