Advertisement
Descaii

UI Test

Sep 2nd, 2014
455
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 5.57 KB | None | 0 0
  1. Player = game.Players.LocalPlayer
  2. Mouse = Player:GetMouse()
  3. PlayerGui = Player:WaitForChild("PlayerGui")
  4. Screen = Instance.new("ScreenGui",PlayerGui)
  5. Top = Instance.new("TextButton",Screen)
  6. Top.Size = UDim2.new(0,224,0,30)
  7. Top.Style = "RobloxRoundButton"
  8. Top.Text = "Server 1"
  9. Top.TextColor3 = Color3.new(230/255,230/255,230/255)
  10. Top.TextStrokeTransparency = 0.8
  11. Top.Active = true
  12. Top.Draggable = true
  13. Top.AutoButtonColor = false
  14. Top.TextXAlignment = "Left"
  15. Top.ZIndex = 5
  16. local TopConnected = Instance.new("ImageLabel",Top)
  17.     TopConnected.BackgroundTransparency = 1
  18.     TopConnected.Image = "rbxassetid://176612478"
  19.     TopConnected.Parent = Top
  20.     TopConnected.Position = UDim2.new(1,-15,0,-5)
  21.     TopConnected.Size = UDim2.new(0,16,0,16)
  22.     TopConnected.ZIndex = 6
  23.     TopConnected.BackgroundTransparency = 1
  24.     TopConnected.ImageColor3 = Color3.new(200/255,100/255,0)
  25.     local TopConnectedGlow = TopConnected:clone()
  26.         TopConnectedGlow.Image = "rbxassetid://174654077"
  27.         TopConnectedGlow.Parent = TopConnected
  28.         TopConnectedGlow.ImageTransparency = 0.2
  29.         TopConnectedGlow.Position = UDim2.new(-0.2,0,-0.25,0)
  30.         TopConnectedGlow.Size = UDim2.new(1.5,0,1.5,0)
  31.         TopConnectedGlow.ZIndex = 6
  32.         TopConnectedGlow.ImageColor3 = TopConnected.ImageColor3
  33. Back = Instance.new("TextButton",Top)
  34. Back.Text = ""
  35. Back.Style = "RobloxRoundButton"
  36. Back.Size = UDim2.new(0,220,0,20)
  37. Back.Position = UDim2.new(0,-10,0,10)
  38. Back.AutoButtonColor = false
  39. BTN = 0
  40. function glerp(UD1,UD2,a)
  41.     return UDim2.new(
  42.         UD1.X.Scale+((UD2.X.Scale-UD1.X.Scale)*a),
  43.         UD1.X.Offset+((UD2.X.Offset-UD1.X.Offset)*a),
  44.         UD1.Y.Scale+((UD2.Y.Scale-UD1.Y.Scale)*a),
  45.         UD1.Y.Offset+((UD2.Y.Offset-UD1.Y.Offset)*a)
  46.     )
  47. end
  48. function Button(plyr)
  49.     Back.Size = Back.Size+UDim2.new(0,0,0,40)
  50.     local Bt= Instance.new("TextButton",Back)
  51.     Bt.Size = UDim2.new(0,200,0,40)
  52.     Bt.Position = UDim2.new(0,-2,0,-2+(40*BTN))
  53.     Bt.Style = Back.Style
  54.     Bt.Text = ""
  55.     local Switch = Instance.new("Frame",Bt)
  56.         Switch.Position = UDim2.new(1,-15,-0.5,0)
  57.         Switch.Size = UDim2.new(0,20,2,0)
  58.         Switch.BackgroundTransparency = 1
  59.         local Slider = Instance.new("ImageLabel",Switch)
  60.             Slider.Size = UDim2.new(0,12,1,-14)
  61.             Slider.Position = UDim2.new(0,5,0,6)
  62.             Slider.Rotation = -90
  63.             Slider.BackgroundTransparency = 1
  64.             Slider.ZIndex = 2
  65.             Slider.ImageColor3 = Color3.new(180/255,180/255,180/255)
  66.             Slider.Image = "rbxassetid://176288837"
  67.             local SliderTop = Instance.new("ImageLabel",Slider)
  68.                 SliderTop.Size = UDim2.new(0,14,0,14)
  69.                 SliderTop.Position = UDim2.new(0,5,0,3)
  70.                 SliderTop.BackgroundTransparency = 1
  71.                 SliderTop.ImageColor3 = Color3.new(170/255,170/255,170/255)
  72.                 SliderTop.Image = "rbxassetid://176612478"
  73.             local SliderBottom = SliderTop:clone()
  74.                 SliderBottom.Position = UDim2.new(0,-6,0,3)
  75.                 SliderBottom.Parent = Slider
  76.             local State = Instance.new("ImageButton",Slider)
  77.                 local StateOn = true
  78.                 State.BackgroundTransparency = 1
  79.                 State.Image = "rbxassetid://176612478"
  80.                 State.Parent = Slider
  81.                 State.Size = UDim2.new(0,14,0,14)
  82.                 State.BackgroundTransparency = 1
  83.                 State.ImageColor3 = Color3.new(0,200/255,0)
  84.                 State.Position = UDim2.new(0,5,0,3)
  85.                 State.ZIndex = 3
  86.                 local StateGlow = State:clone()
  87.                     StateGlow.Image = "rbxassetid://174654077"
  88.                     StateGlow.Parent = State
  89.                     StateGlow.ImageTransparency = 0.2
  90.                     StateGlow.Position = UDim2.new(-0.25,0,-0.25,0)
  91.                     StateGlow.Size = UDim2.new(1.5,0,1.5,0)
  92.                     StateGlow.ZIndex = 4
  93.                 StateGlow.MouseButton1Click:connect(function()
  94.                     if StateOn then
  95.                         StateOn = false
  96.                         State.Position = UDim2.new(0,-5,0,3)
  97.                         State.ImageColor3 = Color3.new(200/255,100/255,0)
  98.                     else
  99.                         StateOn = true
  100.                         State.Position = UDim2.new(0,5,0,3)
  101.                         State.ImageColor3 = Color3.new(0,200/255,0)
  102.                     end
  103.                     StateGlow.ImageColor3 = State.ImageColor3
  104.                 end)
  105.                 local GlowSize = Vector2.new(1.5,1.5)
  106.                 StateGlow.MouseEnter:connect(function()
  107.                     GlowSize = Vector2.new(2.5,2.5)
  108.                 end)
  109.                 StateGlow.MouseLeave:connect(function()
  110.                     GlowSize = Vector2.new(1.5,1.5)
  111.                 end)
  112.                 game:GetService("RunService").RenderStepped:connect(function()
  113.                     StateGlow.Size = glerp(StateGlow.Size,UDim2.new(GlowSize.X,0,GlowSize.Y,0),0.1)
  114.                     StateGlow.Position = UDim2.new(-((StateGlow.Size.X.Scale-1)/2),0,-((StateGlow.Size.Y.Scale-1)/2),0)
  115.                 end)
  116.     local Pad1 = Instance.new("Frame",Bt)
  117.         Pad1.BackgroundColor3 = Color3.new(100/255,100/255,100/255)
  118.         Pad1.Position = UDim2.new(0,25,0.5,0)
  119.         Pad1.Size = UDim2.new(1,-45,0,1)
  120.         Pad1.BorderSizePixel = 0
  121.     local Pad2 = Pad1:clone()
  122.         Pad2.Parent = Bt
  123.         Pad2.Size = UDim2.new(0,1,2,0)
  124.         Pad2.Position = UDim2.new(0,25,-0.5,0)
  125.     local Name = Instance.new("TextLabel",Bt)
  126.         Name.Text = plyr ~= nil and plyr.Name or BTN+1
  127.         Name.BackgroundTransparency = 1
  128.         Name.Position = UDim2.new(0.2,-5,0,-5)
  129.         Name.Size = UDim2.new(0.5,0,0,10)
  130.         Name.TextColor3 = Color3.new(200/255,200/255,200/255)
  131.         Name.FontSize = "Size14"
  132.         Name.TextStrokeTransparency = 0.8
  133.         Name.TextStrokeColor3 = Color3.new(0,0,0)
  134.         Name.TextXAlignment = "Left"
  135.         Name.Font = "SourceSans"
  136.     local ID = Name:clone()
  137.         ID.Parent = Bt
  138.         ID.Text = "userId:"..(plyr ~= nil and plyr.userId or "userId: "..BTN+1)
  139.         ID.Position = UDim2.new(0.2,-5,0,10)
  140.     local Image = Instance.new("ImageLabel",Bt)
  141.     Image.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..(plyr ~= nil and plyr.Name or "ROBLOX")
  142.     Image.BackgroundTransparency = 1
  143.     Image.Position = UDim2.new(0,-7,-0.5,0)
  144.     Image.Size = UDim2.new(0,32,2,0)
  145.     BTN = BTN+1
  146. end
  147. for i,v in pairs(game.Players:GetPlayers()) do
  148.     Button(v)
  149. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement