Discuss Scratch

LukeBlack1
Scratcher
4 posts

Define Usernames

Hey so… Im making a game where you can chat with people and im making a change name script for specific players so im trying to define the normal Username (Scratch Name) and the Custom Username (The Username you can choose) but when I talk in the chat, instead of showing my Username it says “0”. Can you help me? Thanks!
dhuls
Scratcher
1000+ posts

Define Usernames

1. You can't make a free chat. You can only use predefined messages.
2. I don't recommend custom usernames, because it allows impersonation.
3. can I see your code?
cobalt61
Scratcher
65 posts

Define Usernames


set to

LukeBlack1 wrote:

Hey so… Im making a game where you can chat with people and im making a change name script for specific players so im trying to define the normal Username (Scratch Name) and the Custom Username (The Username you can choose) but when I talk in the chat, instead of showing my Username it says “0”. Can you help me? Thanks!

cobalt61 wrote:

so did you use a ask block or something, where it tells you to say your custom username? If not to make it just
when green flag clicked
ask [What’s your username] and wait
set [ custom username] to (answer)

Last edited by cobalt61 (May 7, 2021 03:17:56)

LukeBlack1
Scratcher
4 posts

Define Usernames

cobalt61 wrote:

set to

LukeBlack1 wrote:

Hey so… Im making a game where you can chat with people and im making a change name script for specific players so im trying to define the normal Username (Scratch Name) and the Custom Username (The Username you can choose) but when I talk in the chat, instead of showing my Username it says “0”. Can you help me? Thanks!

cobalt61 wrote:

so did you use a ask block or something, where it tells you to say your custom username? If not to make it just
when green flag clicked
ask [What’s your username] and wait
set [ custom username] to (answer)
Yes, I did but Im asking kind of like how Im able to say like the Custom Username block means the Custom Username variable I used to show the Custom Username you set.
LukeBlack1
Scratcher
4 posts

Define Usernames

dhuls wrote:

1. You can't make a free chat. You can only use predefined messages.
2. I don't recommend custom usernames, because it allows impersonation.
3. can I see your code?

Ye im kind of working on making predefined messages, with the Custom Usernames theres not going to be impersonation because I made it to be only for me to be able to use it + its just for testing for future codes. So I want to make it like a block thats called Custom Username/Scratch Username that defines my Custom Username/Scratch Username variable (The one that show the Scratch Username or the current Custom Username), the code to put the username I was thinking to be kind of like this (Also im using “List” to make the chat idk if thats why its wrong):
add [Custom Username/Scratch Username (The block that indicates that I want to show the Custom Username/Scratch Username)] to [Chat v]
Something like that.
The code for talking is:
when green flag clicked
ask [Type anything to start chatting.] and wait
if <(answer) = (answer)> then
ask [Talk] and wait
add [ ] to [Chat v]
add (answer) to [Chat v]
add [From User:] to [Chat v]
add (username) to [list v]
end
So what happens is that I want to make the type “number or text” block and I did it but there's no way to attach it to the define block so I cant make the block that I want define that it is talking about the username because there's no way to attach it, right? Im kind of thinking it like this. Tell me if I'm wrong pls.
define (Username Var)
(username)
I'll later do a keybind for the chat but I was making it on mobile so I couldnt use keys so I used the when green flag clicked.
So it will probably look like:
when [t v] key pressed
ask [Talk] and wait
add [ ] to [Chat v]
add (answer) to [Chat v]
add [From User:] to [Chat v]
add (username) to [list v]

Last edited by LukeBlack1 (May 7, 2021 11:59:08)

LukeBlack1
Scratcher
4 posts

Define Usernames

LukeBlack1 wrote:

dhuls wrote:

1. You can't make a free chat. You can only use predefined messages.
2. I don't recommend custom usernames, because it allows impersonation.
3. can I see your code?

Ye im kind of working on making predefined messages, with the Custom Usernames theres not going to be impersonation because I made it to be only for me to be able to use it + its just for testing for future codes. So I want to make it like a block thats called Custom Username/Scratch Username that defines my Custom Username/Scratch Username variable (The one that show the Scratch Username or the current Custom Username), the code to put the username I was thinking to be kind of like this (Also im using “List” to make the chat idk if thats why its wrong):
add [Custom Username/Scratch Username (The block that indicates that I want to show the Custom Username/Scratch Username)] to [Chat v]
Something like that.
The code for talking is:
when green flag clicked
ask [Type anything to start chatting.] and wait
if <(answer) = (answer)> then
ask [Talk] and wait
add [ ] to [Chat v]
add (answer) to [Chat v]
add [From User:] to [Chat v]
add (username) to [list v]
end
So what happens is that I want to make the type “number or text” block and I did it but there's no way to attach it to the define block so I cant make the block that I want define that it is talking about the username because there's no way to attach it, right? Im kind of thinking it like this. Tell me if I'm wrong pls.
define (Username Var)
(username)
I'll later do a keybind for the chat but I was making it on mobile so I couldnt use keys so I used the when green flag clicked.
So it will probably look like:
when [t v] key pressed
ask [Talk] and wait
add [ ] to [Chat v]
add (answer) to [Chat v]
add [From User:] to [Chat v]
add (username) to [list v]
I finally discovered how to define it, thanks for trying to help me

Powered by DjangoBB