Hey! I’m doing some research for a project I’m working on, and I’m having some problems with it. As you can see in the screenshot below, when the game starts I want to set the “Text” variable to “the first letter of cat is: c”, so what should happen is that “WordCat”'s first letter should be added already existing “Text” variable string, but I’m getting the error you see below when I try to do that. Am I missing something?
That error means that what you are doing is something that can fail and needs to be in a failure context, most commonly an if statement. As far as the script is concerned, WordCat[0] may not exist at any point and therefore needs to be an if statement to handle the possible failure of accessing it.
Could you provide an example of how to correct this code? I’m not sure I understand how to fix the error. Thanks!
if (FirstLetter := WordCat[0]):
set Text += array:
FirstLetter
It worked, thank you!
1 Like