[SOLVED] Why Is This Exceeding The Maximum Callstack?

Hey I’ve Been Trying To Make My Ai Smarter But It Keeps Telling me Maximum Call Stack Exceeded When I Call Move From Within Attack. Anyone Have A Better Idea?

Here’s My Code: [Redacted: No Longer Relevant]

Thanks For Your Time.

Hi @WilliamBoersma31!

With this little information and your way of scripting, it’s a little hard to say what could causing this. Despite that, I did some debugging. Please check the result below.

Hey @Albertos Thanks For The Reply. I’m Not 100% Sure What Made It Go Off So Many Times But I’ve Gotten It To Move To And Attack The Player But It Won’t End It’s Turn Anymore I Put A Console.log Check In For When it Ends It’s Turn And It Comes Up But For Some Odd Reason Does Nothing.

I Haven’t Changed The Code For Ending The Turn And It Worked A Few Nights Ago So I’m Quite Confused Why It’s Just Running The First Line And Freezing.

Update I Noticed It Was Running Twice So I Fixed That And Now It Works.