Skip to content

Instantly share code, notes, and snippets.

@spotco
Last active November 26, 2021 08:03
Show Gist options
  • Select an option

  • Save spotco/e1be005397c2a00aadce9e79693b2ecd to your computer and use it in GitHub Desktop.

Select an option

Save spotco/e1be005397c2a00aadce9e79693b2ecd to your computer and use it in GitHub Desktop.
un_spdecal.lua
local function get_spdecal(cur)
local child_spdecal = cur:FindFirstChild("SPDecal")
if child_spdecal == nil then
return false, ""
end
return true, child_spdecal.Value
end
local function r_itr(cur)
for _,child in pairs(cur:GetChildren()) do
r_itr(child)
end
if cur.ClassName == "Decal" or cur.ClassName == "Texture" then
local has_spdecal, spdecal_str = get_spdecal(cur)
if has_spdecal == true then
cur.Texture = spdecal_str
end
end
if cur.ClassName == "ImageLabel" then
local has_spdecal, spdecal_str = get_spdecal(cur)
if has_spdecal then
cur.Image = spdecal_str
end
end
if cur.ClassName == "MeshPart" then
local has_spdecal, spdecal_str = get_spdecal(cur)
if has_spdecal then
cur.TextureID = spdecal_str
end
end
end
r_itr(game.Selection:Get()[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment