Is it because of the huge amount of scripts in hundreds of parts, or is it because I didn't use FilteringEnabled?
To be more specific, my game currently has 502 coins (just normal parts) and all of them have scripts inside. Seems like a very huge amount right?
I know, the description is short but all I need is some advice on how to reduce lag and make my game playable to everyone
Instead of having a separate script in every coin, you can just use one script and iterate through all the coins.
While you might do something like this in every coin script that you have:
script.Parent.Touched:Connect(function() --give coin here end)
You are able to delete all the scripts in every coin and use just one script (possibly in ServerScriptService), and if you have all coin parts inside a folder/model called Coins in workspace, do something like this:
for _,coin in pairs(workspace.Coins:GetChildren()) do if coin:IsA("BasePart") then coin.Touched:Connect(function() --give coin here end) end end
Also, if you have a large number of small parts that do not require collisions to be calculated on that small of a scale, you can try anchoring them all and setting all their CanCollide to false, and then just use a single invisible part with CanCollide true to act as a boundary.
You can also look here for more reading on improving the perfromance of your game.