how to fix this problem in code

tbh there are multiple wrong things in your code:

  • while[true] doesn’t exist
  • most of the indent is wrong
  • Player.GetFortCharacter is failable hence needs to be called with square brackets
  • your if condition is also wrong

You should watch some more tutorials, I feel like this is taken from ChatGPT or smth, because the error shouldn’t be the first that popped