Advertisement
Descaii

Clock

Jul 26th, 2014
750
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.63 KB | None | 0 0
  1. -- Clock --
  2. --87349315
  3. Player = game.Players.LocalPlayer
  4. Mouse = Player:GetMouse()
  5. PlayerGui = Player:WaitForChild("PlayerGui")
  6. Screen = Instance.new("ScreenGui",PlayerGui)
  7. local Clock = Instance.new("ImageLabel",Screen)
  8. Clock.Size = UDim2.new(0,200,0,200)
  9. Clock.Position = UDim2.new(1,-250,1,-250)
  10. Clock.Image = "http://wwww.roblox.com/asset/?id="..168503034-1
  11. Clock.BackgroundTransparency = 1
  12. local RTime = Instance.new("TextLabel",Clock)
  13. RTime.Size = UDim2.new(1,0,0.2,0)
  14. RTime.Position = UDim2.new(0,0,-0.2,0)
  15. RTime.BackgroundTransparency = 1
  16. local WiCircle = Instance.new("ImageLabel",Clock)
  17. WiCircle.Size = UDim2.new(0,6,0,6)
  18. WiCircle.BackgroundTransparency = 1
  19. WiCircle.Image = "http://www.roblox.com/asset/?id="..158511004-1
  20. WiCircle.ZIndex = 2
  21. local Second = Instance.new("Frame",Clock)
  22. Second.Size = UDim2.new(0,Clock.AbsoluteSize.Y*0.45,0,0)
  23. local Minute = Instance.new("Frame",Clock)
  24. Minute.Size = UDim2.new(0,Clock.AbsoluteSize.Y*0.35,0,3)
  25. local Hour = Instance.new("Frame",Clock)
  26. Hour.Size = UDim2.new(0,Clock.AbsoluteSize.Y*0.25,0,3)
  27. Second.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  28. Minute.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  29. Hour.BackgroundColor3 = Color3.new(0.5,0.5,0.5)
  30. Hour.BorderSizePixel = 0
  31. Minute.BorderSizePixel = 0
  32. Second.BorderColor3 = Color3.new(0.5,0.5,0.5)
  33. local Rot
  34. Rot = -90
  35. Time = 0
  36. while wait() do
  37.     Time = tick()
  38.     local Sec = math.ceil(Time%60)
  39.     local Min = Time%(60*60)
  40.     local Hr = Time%(60*60*12)
  41.     local RotS = (360*(Sec/60))-90
  42.     local RotM = (360*(Min/(60*60)))-90
  43.     local RotH = (360*(Hr/(60*60*12)))-90
  44.     RTime.Text = tostring(#tostring(math.floor(tick()%86400/60/60%12))>1 and tostring(math.floor(tick()%86400/60/60%12)) or "0"..tostring(math.floor(tick()%86400/60/60%12)))..":"..(math.ceil(Min/60)-1)..":"..Sec
  45.     local OffUI = UDim2.new(0,Clock.AbsoluteSize.X/2,0,Clock.AbsoluteSize.Y/2)
  46.     local OffSec = (OffUI-UDim2.new(0,Second.AbsoluteSize.X/2,0,Second.AbsoluteSize.Y/2))+UDim2.new(0,math.cos(math.rad(RotS))*(Second.AbsoluteSize.X/3),0,math.sin(math.rad(RotS))*(Second.AbsoluteSize.X/3))
  47.     local OffMin = (OffUI-UDim2.new(0,Minute.AbsoluteSize.X/2,0,Minute.AbsoluteSize.Y/2))+UDim2.new(0,math.cos(math.rad(RotM))*(Minute.AbsoluteSize.X/2),0,math.sin(math.rad(RotM))*(Minute.AbsoluteSize.X/2))
  48.     local OffHour = (OffUI-UDim2.new(0,Hour.AbsoluteSize.X/2,0,Hour.AbsoluteSize.Y/2))+UDim2.new(0,math.cos(math.rad(RotH))*(Hour.AbsoluteSize.X/2),0,math.sin(math.rad(RotH))*(Hour.AbsoluteSize.X/2))
  49.     Second.Rotation = RotS
  50.     Minute.Rotation = RotM
  51.     Hour.Rotation = RotH
  52.     Second.Position = OffSec
  53.     Minute.Position = OffMin
  54.     Hour.Position = OffHour
  55.     WiCircle.Position = OffUI-UDim2.new(0,3,0,3)
  56. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement