Exhausted Allowed Execution Time

Hello!
I’m having an issue with Roblox Studio that says exhausted allowed execution time and when I click on the error message, it brings me to: task.spawn(function().
In the function there is a while true do loop with a task.wait(.1) in the loop.

I don’t know why it still brings this error when I have a task.wait(.1) in it. How do I prevent Roblox Studio from almost crashing and bringing this error?

(Error:)

  14:30:39.988  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.988  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:39.988  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.988  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.989  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.989   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:39.989  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.990  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.990  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.992  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.992  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.992  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.993  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:39.993  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.993  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.994  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.994   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:39.994  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.995  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.995  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.996  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.996   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:39.997  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.997  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.998  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.998  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:39.999  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:39.999  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:39.999  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.000  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.000  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.000  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.001  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.001   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.001  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.002  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.002  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.003  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.003   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.003  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.004  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.004  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.005  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.006  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.006   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.006  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.007  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.008  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.008  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.008  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.009  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.009  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.010  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.010  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.010  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.010  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.011  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.011   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.012  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.012  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.013  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.013  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.013   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.014  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.014  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.015  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.015  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.016  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.016   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.016  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.017  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.017  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.018  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.018  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.019  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.019   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x5)  -  Studio
  14:30:40.020  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.020  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.021  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.021  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.022  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.022  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.023  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.023  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.023  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.023  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.024  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.024  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.024  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.025  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.025  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.025  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.026  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.026  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.026  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.026  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.027  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.027   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.027  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.028  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.028  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.029  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.029  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.030  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.030  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.030  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.030  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.031  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.031   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.032  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.032  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.032  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.033  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.033   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.033  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.034  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.034  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.035  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.036  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.036  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.037  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.037  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.037  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.038  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.038  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.038   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.038  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.039  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.040  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.040  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.041   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.041  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.042  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.042  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.043  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.043  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.043   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.044  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.044  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.045  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.046  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.046  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.047  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.047  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.047  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.047  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.048  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.048  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.049  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.049   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.049  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.050  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.050  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.050  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.051   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.051  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.051  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.052  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.052  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.053  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.053   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.054  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.054  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.055  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.055  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.056  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.056  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.056   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x5)  -  Studio
  14:30:40.057  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.058  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.059  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.059  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.060  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.060  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.061  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.061  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.061  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.062  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.062  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.062  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.063  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.063   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.063  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.064  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.064  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.065  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.065   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.066  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.066  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.067  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.067  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.068  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.068   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.068  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.069  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.070  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.070  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.071  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.071  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.071   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x5)  -  Studio
  14:30:40.072  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.072  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.073  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.073  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.074  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.074  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.075  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.075   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x6)  -  Studio
  14:30:40.076  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.076  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.077  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.077  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.078  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.078  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.079  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.079  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.079  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.080  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.080  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.081  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.081  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.081  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.081  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.081  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.082  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.082  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.082  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.083  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.083  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.083  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.083  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.084  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.084  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.085  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.085  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.085  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.085  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.085  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.086  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.087  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.087   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.087  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.088  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.088  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.089  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.089  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.089  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.089  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.090  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.090  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.090  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.091  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.091  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.091  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.092  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.092  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.092  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.093  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.094  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.094   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.094  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.095  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.095  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.096  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.096  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.096  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.096  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.097  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.097  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.099  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.099   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.099  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.100  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.100  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.101  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.101   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.101  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.102  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.102  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.103  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.104  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.104  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.104  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.104  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.105  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.105  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.105  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.106  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.106  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.106  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.107  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.107  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.107  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.108  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.108  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.108   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.109  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.109  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.110  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.110  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.110  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.111  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.111  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.111  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.112  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.112  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.112   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.113  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.113  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.114  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.114  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.114   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.115  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.115  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.116  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.116  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.117  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.117  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.117  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.117  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.117  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.118  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.118  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.118   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.119  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.119  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.119  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.120  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.120   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.121  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.121  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.122  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.122  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.123  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.123   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.123  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.124  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.124  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.125  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.126  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.126  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.127  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.127  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.127  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.128  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.128  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.128  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.129  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.129  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.129  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.130  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.130  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.130  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.130  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.131  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.131   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.131  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.132  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.132  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.133  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.133  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.133  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.133  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.133  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.134  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.135  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.135   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.135  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.136  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.136  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.137  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.137   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.138  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.138  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.139  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.139  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.140  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.140  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.141  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.141  Maximum event re-entrancy depth exceeded for ScriptContext.Error  -  Studio
  14:30:40.141  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.142  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.142  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.142   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x2)  -  Studio
  14:30:40.143  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.143  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.144  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.144  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.145   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x3)  -  Studio
  14:30:40.145  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.145  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.146  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.147  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.147  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.147   ▶ Maximum event re-entrancy depth exceeded for ScriptContext.Error (x4)  -  Studio
  14:30:40.148  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.149  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.149  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.150  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.150  Script timeout: exhausted allowed execution time  -  Client - CoreScripts/CoreScriptErrorReporter:113
  14:30:40.151  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio
  14:30:40.151  Script timeout: exhausted allowed execution time  -  Client - watchForErrors:6
  14:30:40.151  Maximum event re-entrancy depth exceeded for ScriptContext.ErrorDetailed  -  Studio

[...]

Can you send the script itself?

Did you put the task.wait() inside the task.spawn()?, if so please put it outside because the loop will not yield for that as its in another thread.

I’m sorry for the late answer.
Here’s the function:

	task.spawn(function()
		task.wait(.1)
		print("gamemodeVoteAmount task")
		while true do
			task.wait(.1)
			for index,gamemode in pairs(ReplicatedStorage:WaitForChild("Voting"):WaitForChild("Gamemodes"):GetChildren()) do
				local gamemodeVoteAmount = gamemode.Value
				local gamemodeName = gamemode.Name

				local gamemodeUI = HomePage.gamemodes.GamemodeVoting[gamemodeName]
				local gamemodeUIVoteCount = gamemodeUI:WaitForChild("VoteCount")

				gamemodeVoteAmount.Text = tostring(gamemodeVoteAmount)

				print("gamemodeVoteAmount Text for " ..gamemodeName.. " updated.")
			end
		end
	end)

Is that enough or do you need more?
There’s a folder called “Voting” in ReplicatedStorage. In that folder there’s another folder called “Gamemodes”. For each gamemode, I want the UI to update a textlabel to the amount of votes for the gamemode which are in the value of the gamemode numbervalue (inside of the Gamemodes folder)

Why do you need while true here?

Oh. I think I didn’t understand the meaning of task.spawn here. I never really used task before. I removed the while true now but it still crashes in the same line. It also still says exhausted allowed execution time.

It crashes in the first line. (task.spawn(function())

Send the new full task.spawn function

So it says that it’s in that function. But I don’t see where.
(This is the code now:)

task.spawn(function()
		task.wait(0.1)
		print("gamemodeVoteAmount task spawned.")
		for index,gamemode in pairs(ReplicatedStorage:WaitForChild("Voting"):WaitForChild("Gamemodes"):GetChildren()) do
			local gamemodeVoteAmount = gamemode.Value
			local gamemodeName = gamemode.Name

			local gamemodeUI = HomePage.gamemodes.GamemodeVoting[gamemodeName]
			local gamemodeUIVoteCount = gamemodeUI:WaitForChild("VoteCount")

			gamemodeVoteAmount.Text = tostring(gamemodeVoteAmount)

			print("gamemodeVoteAmount Text for " ..gamemodeName.. " updated.")
		end
	end)
task.spawn(function()
		task.wait(0.1)
		print("gamemodeVoteAmount task spawned.")
		for index,gamemode in pairs(ReplicatedStorage:WaitForChild("Voting"):WaitForChild("Gamemodes"):GetChildren()) do
			local gamemodeVoteAmount = gamemode.Value
			local gamemodeName = gamemode.Name

			local gamemodeUI = HomePage.gamemodes.GamemodeVoting[gamemodeName]
			local gamemodeUIVoteCount = gamemodeUI:WaitForChild("VoteCount")

			gamemodeVoteAmount.Text = tostring(gamemodeVoteAmount)

			print("gamemodeVoteAmount Text for " ..gamemodeName.. " updated.")
		end
	end)

What are you doing here? What is the type of this value?

local gamemodeVoteAmount = gamemode.Value
gamemodeVoteAmount.Text = tostring(gamemodeVoteAmount)

gamemode is a NumberValue. I’m then setting the Text of a TextLabel to the Value of the NumberValue but as a string.

No. You are trying to set Text of NumberValue:

local gamemodeVoteAmount = gamemode.Value
gamemodeVoteAmount.Text = tostring(gamemodeVoteAmount)

Try change the name

Oh, I’m stupid.

I edited it. This is the code now:

task.spawn(function()
		task.wait(0.1)
		print("gamemodeVoteAmount task spawned.")
		for index,gamemode in pairs(ReplicatedStorage:WaitForChild("Voting"):WaitForChild("Gamemodes"):GetChildren()) do
			local gamemodeVoteAmount = gamemode.Value --Amount of votes of the gamemode numbervalue
			local gamemodeName = gamemode.Name --Name of gamemode numbervalue

			local gamemodeUI = HomePage.gamemodes.GamemodeVoting[gamemodeName] --Gamemode template clone
			local gamemodeUIVoteCount = gamemodeUI:WaitForChild("VoteCount") --TextLabel
	
			gamemodeUIVoteCount.Text = tostring(gamemodeVoteAmount) --Set the TextLabel's text to the amount of votes

			print("gamemodeVoteAmount Text for " ..gamemodeName.. " updated.")
		end
	end)

I tested it and it’s still crashing tho

Are you sure it’s right here? I see no reason for this

Error

Explorer
image

Script

So yes, it should be that spot.

Main:314. And this is not line 314 :confused:

I’m so sorry. What does the last - Client - Main:242 mean then tho? I then just simply don’t know how to read error messages.

Also, in line 314, it only says intermission() and in intermission(), there’s no loop without a task.wait() in it. Could be, that I’m just completely stupid right now. I’ll just look over it again until I find it. It seems like it’s all just stupid mistakes. Thanks for the help tho!

1 Like

show us line 314 of your main script.