Skip to content

Instantly share code, notes, and snippets.

@spotco
Created May 15, 2017 02:11
Show Gist options
  • Select an option

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

Select an option

Save spotco/523fe43e1ef597078ca4dde0b371ecc3 to your computer and use it in GitHub Desktop.
RemoveUIOffset.lua
local selection_part = game.Selection:Get()[1]
function r_itr(cur)
pcall(function()
local position = cur.Position
local size = cur.Size
if typeof(size) ~= "UDim2" or typeof(position) ~= "UDim2" then
return
end
cur.Position = UDim2.new(math.abs(position.X.Scale),0,math.abs(position.Y.Scale),0)
cur.Size = UDim2.new(math.abs(size.X.Scale),0,math.abs(size.Y.Scale),0)
end)
for _,child in pairs(cur:GetChildren()) do
r_itr(child)
end
end
r_itr(selection_part:GetChildren()[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment