Yes, I know this. Every network call is in a pcall but it still doesn’t make much of a difference.
To determine whether it is internal or the game, turn off all the scripts by disabling them. If error still persist, assume internal errors.
Otherwise, have one script disabled at a time and test. If one script is identified to be the source of the problem, post it here.
Alright, so I found the script that’s causing the server to not respond. It’s “PlayerHandler”.
I put a few print statements around and apparently it doesn’t print after this line:
store = game:GetService("DataStoreService"):GetDataStore("GameData")
Here’s the full code block:
local store = nil
local success, err = pcall(function()
store = game:GetService("DataStoreService"):GetDataStore("GameData")
end)
if(success == false) then
print(err)
end
Very confusing though. Since sometimes (well, rarely) the game might run fine but then something seemingly random would crash it.
I don’t think pcall is necessary for the data store. You can just put it directly on the variable.
Only use pcall when saving and loading(using functions from the data store).
I know, I just forgot to remove that since I disabled studio datastore API access before. This wouldn’t make much of a difference though, right?
Apparently yes, keep on testing around the script until you think you found the rightful method to avoid this complication.
Since I’m on vacation at the moment, I don’t have access to Studio. Thus, limited resources and tools to avail.
Try Ro-Defender. There is a way to get your character so they could be opening servers and adding in one variant of your character.
I think I found the line number causing the issue. This is already a strange issue as it is, but now it’s even stranger.
I commented out multiple lines and sourced the crashing issue to be from this line:
local defaultStats = {100,50,400}
Yes, a table was causing the server to crash.
what is happening roblox
If you copy the script you suspect is the problem into a new baseplate and fix it so it still runs, does the problem still happen?
Yep. Found the issue.
It was this block in my anti-exploit script:
plr.Character.ChildRemoved:Connect(function(child)
if(child:IsA("BasePart")) then
plr:LoadCharacter()
return
end
end
Why this caused an issue is beyond me, but i’m guessing it runs when my player handler script respawns them, but during respawning, it removes all their parts, which causes this to run, which causes this same process to happen but multiplied by the amount of parts in the player, and this keeps looping until eventually the server gives up from the amount of respawns it has to deal with.
(ChildAdded and ChildRemoved gives me so much issues…)
Anyway thank you all for your help and i’m so glad this issue was resolved!