I’ve seen in another devforum post that to check if a part has specific properties, to use pcall to check if there are specific properties, the only problem is that I don’t know how to check if there are surface studs/inlets. This is my current script, a server script in workspace.
for i, studpart in pairs(game.Workspace:GetDescendants()) do
if studpart:IsA("Part") then
local studcall = pcall(function() has (v, "Studs") end)
if studcall then
studpart.Surface.TopSurface = "Smooth"
local studtex = Instance.new("Texture")
studtex.Texture = studtex.assetId == "http://www.roblox.com/asset/?id=9818768"
studtex.Face = "Top"
local inletcall = pcall(function() has (v, "Inlets") end)
if inletcall then
studpart.Surface.BottomSurface = "Smooth"
local studtex = Instance.new("Texture")
studtex.Texture = studtex.assetId == "http://www.roblox.com/asset/?id=65432522"
studtex.Face = "Bottom"
end
end
end
end
Essentially what it does is grabs any part in the workspace that has studs or inlets, changes their surfaces to smooth, and adds a texture on top of the surface that had previously had studs on it.
It doesn’t seem to want to work, so I’m asking what is the correct way to know how to get parts with studs/inlets, so I can fix this.