Discuss Scratch
- Discussion Forums
- » Questions about Scratch
- » Need new block.
- jay11vad
-
Scratcher
30 posts
Need new block.
I really NEED this block:
Is there another way?
(costume name)
Is there another way?
Last edited by jay11vad (Dec. 22, 2020 20:31:28)
- jay11vad
-
Scratcher
30 posts
Need new block.
I need
I would use it like this:
(costume name).
I would use it like this:
when green flag clickedIs there an alternative way because I can' find any other way.?
if <(costume name ) = []> then
hide
end
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
I needYou can do with costume numbers. Also that block exists at the end of the ‘Looks’ section.(costume name).
I would use it like this:when green flag clickedIs there an alternative way because I can' find any other way.?
if <(costume name ) = []> then
hide
end
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
What do I do instead of this: because this is not a real block???
'when costume switches to [ v]
???
or:
'If costume switches to [ v]
What do I do instead of this: because this is not a real block???
'when costume switches to [ v]
???
or:
'If costume switches to [ v]
if <(costume [name v] ::looks) = [random costume lol]> then
end
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
Also this:You meanIf [ left-up v] pressed together then
if <<key [ v] pressed?> and <key [ v] pressed?>> thenor
end
Makey Makey icon|when (left up v) pressed in order ::pen hat
- best-games-ever
-
Scratcher
500+ posts
Need new block.
Put all of your block suggestions in the “Suggestions” forum please. This topic doesn't belong here.
- codinglah
-
Scratcher
100+ posts
Need new block.
No problem! Just a reminder, chatroom projects are NOT allowed on Scratch.thx i will try this sometime in an chatbot maibe ? actually you could use this to detect the category an word is in like greetings info jokes fun and so oncan i sugest an block ? it takes 2 or more lists and one var and it compares how many letters each word has from all items in an list if the var is an sentence it breaks it down into words this would be really helpfull in making an chatroom that bans on bad language or then requires u to us savechat it could be an basic AI block that could be implemented into scratch if developers feel like itActually, cloud chatrooms are not allowed on Scratch. But yes, I think that would be useful. A workaround would be:when green flag clicked
set [counter v] to (1)
repeat (length of (sentence))
if <(item (counter) of (sentence)) = [ ]> then
set [length v] to (length of (word))
add (length) to [lengths v]
add (word) to [words v]
change [counter v] by (1)
if <(words) contains (bad words :: list)?> then
say [Oops! A bad word is detected. Please re-phrase your sentence.]
stop [this script v]
end
else
set [word v] to (join (word) (item (counter) of (sentence)))
change [counter v] by (1)
end
end
- coderpilot72
-
Scratcher
28 posts
Need new block.
You want aprevious costume :: looksblock? Yeah, something like that would be better in the Suggestions category. Try posting there.
Here's a simple workaround:switch costume to ((costume #) - (1))
Well you can do that but if you are at costume 4 and you want to get to costume 2 you can do this:
when green flag clicked
switch costume to ((costume #) / (2))
or some thing like that!
- GamerMarcus646
-
Scratcher
100+ posts
Need new block.
This:Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.switch costume to [((costume name) - (1)) v]
…Only works once. I did try that but I've got 29 costumes for my sprite. It was on ‘flying cat 1’ and it did work - when I pressed space it went to ‘black cat’ - which was good, but then when I pressed space again, it did not switch to the costume ‘white cat’. Is there another solution?
switch costume to ((costume #) - (1))Next costume:
switch costume to ((costume #) + (1))
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.Not necessary.switch costume to ((costume #) - (1))Next costume:switch costume to ((costume #) + (1))
- GamerMarcus646
-
Scratcher
100+ posts
Need new block.
It’s just what I do when I run into the problem OP has, but thanks for letting me know that I’ve been doing things wrong! Writing clean, optimized code is kind of hard.Name all of your sprites numbers. For example: name costume 1 “1” and costume 2 “2”. Use the code below to switch to the previous costume.Not necessary.switch costume to ((costume #) - (1))Next costume:switch costume to ((costume #) + (1))
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
…not one that is stuck in one placeI don't think that's possible here.
- jay11vad
-
Scratcher
30 posts
Need new block.
Ok then, never mind. But how do I hide this;?
(current [ v])
- SparshG
-
Scratcher
500+ posts
Need new block.
What do I do instead of this: because this is not a real block???when costume switches to [ v]
If costume switches to [ v]
forever
if <(costume [name v] :: looks) = [cat]> then
...
end
end
for picking random BETWEEN two numbers
(pick random ((1) + (1)) to ((10) - (1)))//random between 1 and 10
(pick random ((var1) + (1)) to ((var2) - (1)))//random between var1 and var2
for switching to previous costume
switch costume to ((costume [name v] :: looks) - (1))
If you want more blocks, you can look into hacked blocks: https://scratch.mit.edu/projects/453337690/
Last edited by SparshG (Dec. 26, 2020 05:19:09)
- Monna-Uka
-
Scratcher
1000+ posts
Need new block.
Sorry, but currently, Scratch can't bring you to another scratch project using code,
or apply code to multiple sprites. You could request these in the “Requests forum”.
For the pick random of two numbers block, you could use a workaround, like making a list of the two numbers, and picking a random one:(item (pick random (1) to (2)) of [list v] :: list)
Hope this helped.
((number 1) + ((pick random (0) to (1)) * ((number 2) - (number 1))))^ better workaround, without lists.
- jay11vad
-
Scratcher
30 posts
Need new block.
I found this block in a project:
Is this a hack block?
create (15) clones of [ sprite3v]
Is this a hack block?
Last edited by jay11vad (Dec. 31, 2020 16:17:12)
- Ihatr
-
Scratcher
1000+ posts
Need new block.
I found this block in a project:Where is the project?create [15] clones of [ sprite3 v] :: control
Is this a hack block?
- the2000
-
Scratcher
1000+ posts
Need new block.
I was gonna call for this thread to be closed, but this has me intrigued. Link please? (It's unlikely, but what if this is another one of those hidden blocks? I love using those to optimize my code far beyond a necessary amount)I found this block in a project:Where is the project?create [15] clones of [ sprite3 v] :: control
Is this a hack block?
- Discussion Forums
- » Questions about Scratch
-
» Need new block.








