Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » how do you use usernames in your games
- DaEpikDude
-
Scratcher
1000+ posts
how do you use usernames in your games
any tips on its uses?
say (join [hello ] (join (username) [how are you today]))
- Lu2333
-
Scratcher
100+ posts
how do you use usernames in your games
any tips on its uses?You Can Use It To Address The Viewer By Username Without Them Needing To Ask “What's Your Name?” At The Beginning.
- YubNubEwok
-
Scratcher
1000+ posts
how do you use usernames in your games
Here:
(username)
any tips on its uses?
say [Hello] for (2) secs
say (username)//This is useful for chatbot projects
- DaEpikDude
-
Scratcher
1000+ posts
how do you use usernames in your games
Here:better version(username)any tips on its uses?say [Hello] for (2) secs
say (username)//This is useful for chatbot projects
say (join [Hello ] (username)) for (3) secs
- YubNubEwok
-
Scratcher
1000+ posts
how do you use usernames in your games
Ah, okay, so that's what I've been doing wrong this whole time….Here:better version(username)any tips on its uses?say [Hello] for (2) secs
say (username)//This is useful for chatbot projectssay (join [Hello ] (username)) for (3) secs
- _Circuit-
-
Scratcher
82 posts
how do you use usernames in your games
Think of the block as a variable, one which you cannot change and is always set to the username of the user currently running the project.
If you use it like:
You can set an actual variable to the username block. This is useful for OSes or other instances where you need someone's username, like a welcome message:
If you want to use it in a chatbot, you will have to use the
You don't have to use only one join block in a script. You can use as many as you want!
There are endless possibilities of what the (username) block can do. Recently, I made a username detector which displays your username in actual letters, instead of variables.
If you use it like:
say (username)the sprite will say the user's username.
You can set an actual variable to the username block. This is useful for OSes or other instances where you need someone's username, like a welcome message:
set [username v] to (username)
If you want to use it in a chatbot, you will have to use the
(join [hello] [world])block. You can use the following script if you want, it's all yours.
add (join [chatbot: Welcome, ] (username)) to [chatbot v]
You don't have to use only one join block in a script. You can use as many as you want!
add (join [chatbot: Welcome, ] (join (username) [!])) to [chatbot v]
There are endless possibilities of what the (username) block can do. Recently, I made a username detector which displays your username in actual letters, instead of variables.
- Candylanguagegirl
-
Scratcher
1000+ posts
how do you use usernames in your games
You can set an actual variable to the username block. This is useful for OSes or other instances where you need someone's username, like a welcome message:Please note that the username block is already a variable- I can't think of many situations where transferring it to a different variable would be useful, since the username is at no risk of changing mid-game.set [username v] to (username)

Last edited by Candylanguagegirl (Nov. 19, 2017 11:57:28)
- scratch_king3
-
Scratcher
29 posts
how do you use usernames in your games
how about
add (username) to [list v]then
say thanks to(list :: list)
- Maarten_
-
Scratcher
100+ posts
how do you use usernames in your games
Detect if an user is a guest:
if <(username) = []> thenDetect if an user is a guest and can use cloud (1 time use):
say [User is a guest!]
else
say [User is not a guest!]
end
if <(username) = []> then
say [User is a guest and can't use cloud!]
else
set [☁ Cloud v] to [1]
if <(☁ Cloud) = [1]> then
say [User is not a guest and can use cloud!]
else
say [User is not a guest and can't use cloud!]
end
end
- scratch_king3
-
Scratcher
29 posts
how do you use usernames in your games
@DaEpikDude
love your signature
love your signature
- Charles12310
-
Scratcher
1000+ posts
how do you use usernames in your games
@DaEpikDudeIt doesn't seem to waste space. I've really wondered about other signatures too.
love your signature
Anyways, let's go back on topic.
- Discussion Forums
- » Questions about Scratch
-
» how do you use usernames in your games







