Currently, I have a script in the workspace that is supposed to place a texture on everything in the game. When I have the script disabled, I am able to load in, but when it’s enabled, studio freezes or crashes.
print("loaded")
for i, v in pairs(workspace:GetDescendants()) do
if v:IsA("Part") and v.TopSurface == Enum.SurfaceType.Studs then
local newStuds = workspace.Studs:Clone()
newStuds.Name = "Studs"
newStuds.Parent = v
v.BottomSurface = Enum.SurfaceType.Inlet
--newStuds.StudsPerTile
end
end
You’re cloning workspace.Studs for every basepart; the issue with that is there’s 2 workspace.Studs and one of them is a script.
Basically, you (may have) created a recursive script that clones itself (and starts running again) for every basepart that exists; then, all of those will also run, creating an infinite loop and causing Studio or the game to freeze indefinitely.
Try renaming or moving your script; I’d recommend placing it in ServerScriptService since it doesn’t reference any parents/children anyways, so you shouldn’t even have to change anything.