Hello everyone, I need help writing a script code. The idea is that any random hero enters a specific building, and this building checks if the hero has a perk and gives him a bonus for that perk. The problem is that I need to check if the hero has many perks and give him many bonuses if he has them. I only learned how to write code to check for one perk, and the game doesn't read further. I ask coders to help, I need a максимально simple script of this kind: function perksF (heroname) if "hero has skill" (heroname, for example, the skill of archery) then "add creatures to hero" (heroname, for example, archers, in the amount of 1) also if "hero has skill" (heroname, for example, skilled logistics) then "add artifact to hero" (heroname, for example, shackles of fate, non-transferable) also if "hero has skill" (heroname, for example, advanced logistics) then "change hero stat" (heroname, for example, defense, +2) also if "hero has skill" (heroname, for example, advanced light) then "teach hero a spell" (heroname, for example, slow at the skilled level) end end Trigger (hero touches an object called tttt, launch the perksF function) The examples themselves can be different, the principle and logic of writing the code are important, so that one touch trigger checks a large number of perks and gives the hero creatures, an artifact, a spell. It also needs to have a nil condition, and the touch should work once and not give bonuses a hundred times. I will be grateful for the explanation. Another question: I need a script that will work at the start of a battle. Startcombat if there is a necromancer hero in the battle and if he has the leadership perk, then the enemy hero receives -1 to morale, and similarly for the advanced and skilled level, -2 and -3 morale. Thank you for your help.

Added 9 minutes ago
Friends, can you tell me how many simultaneous functions can be executed in the game? I am currently working on character animations: I create separate functions and launch them using startThread(), but I noticed that exactly on the second startThread() command, the game freezes completely. If I combine all the animations into one function, then everything is okay.