Discuss Scratch

scratch_king3
Scratcher
29 posts

how do you use usernames in your games

the title
DaEpikDude
Scratcher
1000+ posts

how do you use usernames in your games

with this
(username)
scratch_king3
Scratcher
29 posts

how do you use usernames in your games

any tips on its uses?
DaEpikDude
Scratcher
1000+ posts

how do you use usernames in your games

scratch_king3 wrote:

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

scratch_king3 wrote:

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)

scratch_king3 wrote:

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

YubNubEwok wrote:

Here:
(username)

scratch_king3 wrote:

any tips on its uses?
say [Hello] for (2) secs
say (username)//This is useful for chatbot projects
better version
say (join [Hello ] (username)) for (3) secs
YubNubEwok
Scratcher
1000+ posts

how do you use usernames in your games

DaEpikDude wrote:

YubNubEwok wrote:

Here:
(username)

scratch_king3 wrote:

any tips on its uses?
say [Hello] for (2) secs
say (username)//This is useful for chatbot projects
better version
say (join [Hello ] (username)) for (3) secs
Ah, okay, so that's what I've been doing wrong this whole time….
_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:
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

_Circuit- wrote:

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)
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.

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) = []> then
say [User is a guest!]
else
say [User is not a guest!]
end
Detect if an user is a guest and can use cloud (1 time use):
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
Charles12310
Scratcher
1000+ posts

how do you use usernames in your games

scratch_king3 wrote:

@DaEpikDude
love your signature
It doesn't seem to waste space. I've really wondered about other signatures too.

Anyways, let's go back on topic.
scratch_king3
Scratcher
29 posts

how do you use usernames in your games

ok sir

Powered by DjangoBB