Skip to content

Instantly share code, notes, and snippets.

@spotco
Created May 4, 2017 05:59
Show Gist options
  • Select an option

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

Select an option

Save spotco/dac468b06d676c4edd8161a411326c4c to your computer and use it in GitHub Desktop.
surfacegui_to_decal.lua
local selection_part = game.Selection:Get()[1]
local decals = {}
for _,child in pairs(selection_part:GetChildren()) do
if child.ClassName == "SurfaceGui" then
table.insert(decals, child)
end
end
for i=1,#decals do
local itr = decals[i]
local decal = Instance.new("Decal",selection_part)
decal.Texture = itr.ImageLabel.Image
decal.Face = itr.Face
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