Hey, I have around 2-3k active players on my game and when I check the “Error Report” I get a bunch of server errors with all the message “Script timeout: exhausted allowed execution time for the current resumption point”
Some of the scripts are the same just inside different models giving me the error but how is it possible that almost every script manages to give me this error? Is it something wrong in general on the server in that case?
game.Workspace.DraggableFolder.ChildAdded:Connect(function(child)
if not child or not child:IsA("Model") then return end
-- Find or add DragDetector
local dragDetector = child:FindFirstChild("DragDetector")
if not dragDetector then
dragDetector = game.ReplicatedStorage.Addons.DragDetector:Clone()
dragDetector.Parent = child
end
-- Ensure DragScript exists
local dragScript = dragDetector:FindFirstChild("DragScript")
if not dragScript then
dragScript = game.ReplicatedStorage.Addons.DragDetector.DragScript:Clone()
dragScript.Parent = dragDetector
end
-- Always enable
dragDetector.Enabled = true
dragScript.Enabled = true
-- Transfer TempPlayer to LastPlayer if exists
local tempPlayer = child:FindFirstChild("TempPlayer")
if tempPlayer and tempPlayer.Value then
local lastPlayer = dragDetector:FindFirstChild("LastPlayer")
if lastPlayer then
lastPlayer.Value = tempPlayer.Value
end
end
-- Tag enemies with SpawnTime
if child:FindFirstChild("Enemy") and not child:FindFirstChild("SpawnTime") then
local tag = Instance.new("NumberValue")
tag.Name = "SpawnTime"
tag.Value = os.clock()
tag.Parent = child
end
end)
on line 2 on that script it gives me the error.
--// Modules and Setup
local currencyModule = require(game.ServerScriptService.CurrencyModule)
local soundModule = require(game.ServerScriptService.Modules.SoundPosition)
local setupAttachmentsModule = require(game.ServerScriptService.Modules.DragModules.SetupAttachments)
local displayModule = require(game.ServerScriptService.Modules.DragModules.Display)
local tweenService = game:GetService("TweenService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
same here, on line 2 the “currencyModule” give me error. So a bunch of scripts that uses “ChildAdded” are pretty much giving me error but also a bunch of scripts when I just try to require a module?
And I don’t even spam add that many ChildAdded + it does not seem to impact gameplay but it fills up my whole error report making it impossible to find real bugs.
Any help is appreciated!