Advertisement
CloneTrooper1019

Untitled

May 28th, 2014
460
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.37 KB | None | 0 0
  1. self = script.Parent
  2.  
  3. gui = script
  4. while not gui:IsA("ScreenGui") do
  5.     gui = gui.Parent
  6.     if gui.Name == "PlayerGui" then
  7.         error()
  8.     end
  9. end
  10.  
  11. local scale = 0.8
  12.  
  13. function updateSelf()
  14.     local h = gui.AbsoluteSize.Y*scale
  15.     script.Parent.Size = UDim2.new(0,h,0,h)
  16.     script.Parent.Position = UDim2.new(0.5,h/-2,0.5,h/-2)
  17. end
  18.  
  19. updateSelf()
  20. gui.Changed:connect(updateSelf)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement