I created a script that takes any Parts in the workspace with studs and inlets, and makes their material ‘SmoothPlastic’ with Studs and Inlets textures on them, however when I test the script, it doesn’t seem to work. Any help with it will be appreciated.
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.Material = "SmoothPlastic"
local studtex = Instance.new("Texture")
studtex.Texture = ("http://www.roblox.com/asset/?id=9818768")
studtex.Face = "Top"
local inletcall = pcall(function() has (v, "Inlets") end))
if inletcall then
studpart.Material = "SmoothPlastic"
local studtex = Instance.new("Texture")
studtex.Texture = ("http://www.roblox.com/asset/?id=65432522")
studtex.Face = "Bottom"
end
end
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.Material = "SmoothPlastic"
local studtex = Instance.new("Texture")
studtex.Texture = ("http://www.roblox.com/asset/?id=9818768")
studtex.Face = "Top"
local inletcall = pcall(function() has (v, "Inlets") end))
if inletcall then
studpart.Material = Enum.Material.SmoothPlastic
local studtex = Instance.new("Texture")
studtex.Texture = ("http://www.roblox.com/asset/?id=65432522")
studtex.Face = "Bottom"
end
end
you need to use Enum.Material not just “SmoothPlastic”
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.Material = Enum.Material.SmoothPlastic
local studtex = Instance.new("Texture")
studtex.Texture = studtex.assetId = 9818768
studtex.Face = "Top"
local inletcall = pcall(function() has (v, "Inlets") end))
if inletcall then
studpart.Material = Enum.Material.SmoothPlastic
local studtex = Instance.new("Texture")
studtex.Texture = studtex.assetId = http://www.roblox.com/asset/?id=65432522
studtex.Face = "Bottom"
end
end
That also did not seem to work Although I did try 3 other things like adding the full asset link to the stud texture, and also adding quotations to them, but that didn’t seem to work either. Thank you for your help though.