Need help with different types of errors

Hey so I want to make a game where I encode a Secret message and use a random shift to shift the letters in the Secret message and then display it. When I create the function I get thrown in a lot of errors and I don’t know what do.

Some of the errors are “Function is invoked with incorrect failure bracketing style.”
“This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context.”

You have 2 times SecretMessageCode :=, I dont think thats allowed, about the error you get maybe somehwere you use the wrong brackets () / []