Need help with a (if character ( ) located) block

I’m just gonna need help with a block that locates if a character (letter or special character) is located in any form of typing like for example, if you’re trying to make a IRL simulator, you would make a starting amount of money for the simulator’s character (person, etc.), and if there is any sign of a negative symbol ( - ), the game’s over and you have to start over. Here’s how it looks:

IMG_1159

So do you need help with detecting when a user types in a certain character, or if the character is detected in a string / text?

If you want to detect when a certain characters is typed, then just use untitled script pic (18) or untitled script pic (19). If the key isn’t there, use untitled script pic (20) to type in the character you want to detect and drag it into the input of untitled script pic (19).

If you need help with detecting if a certain character is in a string, then you can use this block: untitled script pic (17)

Also I think this would go in the category “Help with Snap!: Snap! editor”

This can be solved with a
(letter (1 v) of (number)) = [-]
or
<(number) \< (0)>

Thank you! da-ultimate-creator, thank you to you too.

Oh, by the way, the (text [ ] contains [ ]) block didn’t work

Apparently, the library this block is from (strings, multiline inputs) has a bug. The extension function used won’t take a number, only a string (text):

I mean you could also just convert the number into a string like this:
untitled script pic (21)

It is nevertheless a bug because, in Snap, there isn’t supposed to be a distinction between number and string.

Yeah, I was just providing a solution to the bug.

For the hat block, just (join @:>) together.

Use this script to explore the supported keys, including ones not listed in the dropdown:

Interesting. It can detect when both the Shift and Ctrl key are being pressed. If you press Shift Ctrl, it will report “shift Control”. But if you press Ctrl Shift, it will report “ctrl shift Shift”.

In fact, it can pretty much detect whenever you Ctrl click or Shift click any key.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.