Created
March 23, 2017 05:13
-
-
Save spotco/f15256545344446fa7fab47a1cd50552 to your computer and use it in GitHub Desktop.
decal_to_surfacegui.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 selection_part = game.Selection:Get()[1] | |
| local decals = {} | |
| for _,child in pairs(selection_part:GetChildren()) do | |
| if child.ClassName == "Decal" then | |
| table.insert(decals, child) | |
| end | |
| end | |
| for i=1,#decals do | |
| local itr = decals[i] | |
| local screengui = Instance.new("SurfaceGui",selection_part) | |
| screengui.Face = itr.Face | |
| screengui.CanvasSize = Vector2.new(100,100) | |
| local img = Instance.new("ImageLabel", screengui) | |
| img.Image = itr.Texture | |
| img.BackgroundTransparency = 1 | |
| img.Size = UDim2.new(0,100,0,100) | |
| end | |
| for i=1,#decals do | |
| decals[i]:Destroy() | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment