Last active
November 26, 2021 08:03
-
-
Save spotco/e1be005397c2a00aadce9e79693b2ecd to your computer and use it in GitHub Desktop.
un_spdecal.lua
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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