Advertisement
haloguy51

Click Counter

Sep 20th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.71 KB | None | 0 0
  1. function GetRainbowRGB(hue)
  2.         local section = hue % 1 * 3
  3.         local secondary = 0.5 * math.pi * (section % 1)
  4.         if section < 1 then
  5.                 return 1, 1 - math.cos(secondary), 1 - math.sin(secondary)
  6.         elseif section < 2 then
  7.                 return 1 - math.sin(secondary), 1, 1 - math.cos(secondary)
  8.         else
  9.                 return 1 - math.cos(secondary), 1 - math.sin(secondary), 1
  10.         end
  11. end
  12. i = 1
  13. function grainbors()
  14.     while true do
  15.         wait()
  16.         local red, green, blue = GetRainbowRGB(tick())
  17.         tex.TextStrokeColor3 = Color3.new(0.6 * red, 0.6 * green, 0.65 * blue)
  18.     end
  19. end
  20. function adpls()
  21.     i = i + 1
  22.     tex.Text = i.." Clicks"
  23. end
  24. podium = Instance.new("Part",script)
  25. podium.Position = Vector3.new(-3,3,34)
  26. podium.Anchored = true
  27. podium.Size = Vector3.new(2, 6, 2)
  28. click = Instance.new("Part",script)
  29. click.Anchored = true
  30. click.Position = Vector3.new(-3, 6.5, 34)
  31. click.Size = Vector3.new(2, 1, 2)
  32. click.BrickColor = BrickColor.new("Really red")
  33. wallthing = Instance.new("Part",script)
  34. wallthing.FormFactor = ("Custom")
  35. wallthing.Anchored = true
  36. wallthing.Size = Vector3.new(69, 26.6, 0.2)
  37. wallthing.Position = Vector3.new(-5, 20.8, 76.9)
  38. wallthing.Transparency = 1
  39. wallthing.CanCollide=false
  40. s = Instance.new("SurfaceGui",wallthing)
  41. s.Adornee = wallthing
  42. tex = Instance.new("TextLabel",s)
  43. tex.BackgroundTransparency = 1
  44. tex.BorderColor3 = Color3.new(27,42,53)
  45. tex.BorderSizePixel = 1
  46. tex.TextColor3 = Color3.new(255,255,255)
  47. tex.Text = "Click the red button"
  48. tex.TextStrokeTransparency = 0
  49. tex.Size = UDim2.new(1,0,1,0)
  50. tex.TextScaled = true
  51. tex.Font = "Legacy"
  52. Instance.new("ClickDetector",click)
  53. click.ClickDetector.MouseClick:connect(adpls)
  54. grainbors()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement