Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Define Usernames
- 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?
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
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!so did you use a ask block or something, where it tells you to say your custom username? If not to make it justwhen 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
set toHey 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!so did you use a ask block or something, where it tells you to say your custom username? If not to make it justYes, 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.when green flag clicked
ask [What’s your username] and wait
set [ custom username] to (answer)
- LukeBlack1
-
Scratcher
4 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?
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 clickedSo 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.
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
define (Username Var)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.
(username)
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
I finally discovered how to define it, thanks for trying to help me1. 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 clickedSo 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.
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]
enddefine (Username Var)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.
(username)
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]

- Discussion Forums
- » Help with Scripts
-
» Define Usernames