Advertisement
Treyzotic

Untitled

Jun 18th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.26 KB | None | 0 0
  1. local module = {}
  2.  
  3.  
  4. function Tween(SizeChange, PositionChange, Parent)
  5. local TweenService = game:GetService("TweenService")
  6. local Info = TweenInfo.new(
  7. .1,
  8. Enum.EasingStyle.Linear,
  9. Enum.EasingDirection.Out,
  10. 0,
  11. false,
  12. 0
  13. )
  14. local Changes = {
  15. Size = SizeChange,
  16. Position = PositionChange
  17. }
  18. local TweenOb = TweenService:Create(Parent, Info, Changes)
  19. return TweenOb
  20. end
  21. function TweenIt(Object, Changes)
  22. local TweenService = game:GetService("TweenService")
  23. local Info = TweenInfo.new(
  24. .05,
  25. Enum.EasingStyle.Linear,
  26. Enum.EasingDirection.Out,
  27. 0,
  28. false,
  29. 0
  30. )
  31. local TweenOb = TweenService:Create(Object, Info, Changes)
  32. return TweenOb
  33. end
  34. local function addpoints(Obj, ClickAmount)
  35. Obj.Text = tostring(tonumber(Obj.Text) + ClickAmount)
  36. end
  37. local function Img(Type, SuppliedImage)
  38. local Img = Instance.new(Type)
  39. Img.BackgroundTransparency = 1
  40. Img.Image = SuppliedImage
  41. Img.BackgroundTransparency = 1
  42. return Img
  43. end
  44. function module.Gui(Playergui, Data)
  45. local ClickAmount = 1
  46. local SG = Instance.new("ScreenGui")
  47. local BoxOneDelay = 4
  48. local BoxTwoDelay = 6
  49. SG.Parent = Playergui
  50.  
  51. local Main = Instance.new("Frame")
  52. Main.Size = UDim2.new(1,0,1,0)
  53. Main.Parent = SG
  54. Main.BackgroundTransparency = 1
  55. Main.Name = "Main"
  56. local Backdrop = Img("ImageLabel", Data.Backdrop)
  57. Backdrop.Size = UDim2.new(1, 0, 1, 0)
  58. Backdrop.Position = UDim2.new(0, 0, 0, 0)
  59. Backdrop.Parent = Main
  60. Backdrop.ZIndex = -1
  61. local IconBg = Img("ImageLabel", Data.IconBG)
  62. IconBg.Position = UDim2.new(.131, 0, 0.229, 0)
  63. IconBg.Size = UDim2.new(0.376, 0, 0.666, 0)
  64. IconBg.Parent = Main
  65. local Button = Img("ImageButton", Data.Icon)
  66. Button.Parent = IconBg
  67. Button.Size = UDim2.new(0.34, 0, 0.359, 0)
  68. Button.Position = UDim2.new(0.34, 0, 0.359, 0)
  69. local MIC = Img("ImageLabel", Data.Icon)
  70. MIC.Parent = IconBg
  71. MIC.Name = "MoneyIcon"
  72. MIC.Size = UDim2.new(0.125, 0, 0.128, 0)
  73. MIC.Position = UDim2.new(0.188, 0, 0.109, 0)
  74. local Pickaxe = Img("ImageLabel", Data.SecondIcon)
  75. Pickaxe.Size = UDim2.new(0.25, 0,0.325, 0)
  76. Pickaxe.Parent = MIC.Parent
  77. Pickaxe.Position = UDim2.new(0.575, 0,0.375, 0)
  78. local Amount = Instance.new("TextLabel")
  79. Amount.Position = UDim2.new(.979, 0, 0, 0)
  80. Amount.Size = UDim2.new(4.578, 0, 1, 0)
  81. Amount.TextSize = 80
  82. Amount.Parent = MIC
  83. Amount.TextXAlignment = Enum.TextXAlignment.Left
  84. Amount.BackgroundTransparency = 1
  85. Amount.Font = Enum.Font.Garamond
  86. Amount.Text = 0
  87. Button.MouseButton1Click:Connect(function()
  88. spawn(function()
  89. local Tweennew = TweenIt(Pickaxe, {Rotation = -75})
  90. Tweennew:Play()
  91. Tweennew.Completed:Wait()
  92. local NewTween = TweenIt(Pickaxe, {Rotation = 0})
  93. NewTween:Play()
  94.  
  95. end)
  96. local TweenPlay = Tween(UDim2.new(0.401, 0, 0.41, 0), UDim2.new(0.299, 0, 0.294, 0), Button)
  97. TweenPlay:Play()
  98. TweenPlay.Completed:Wait()
  99. local BackTween = Tween(UDim2.new(0.34, 0, 0.359, 0), UDim2.new(0.34, 0, 0.359, 0), Button)
  100. BackTween:Play()
  101. addpoints(Amount, ClickAmount)
  102. end)
  103. --[[
  104. RIGHTSIDE FRAME ----------------------------
  105. --]]
  106. local RightFrame = Instance.new("Frame")
  107. RightFrame.Parent = SG
  108. RightFrame.Size = UDim2.new(0.288, 0, 0.567, 0)
  109. RightFrame.Position = UDim2.new(0.506, 0, 0.328, 0)
  110. RightFrame.BackgroundTransparency = 1
  111. local BackdropRightside = Img("ImageLabel", Data.IconBG)
  112. BackdropRightside.Size = UDim2.new(1,0,1,0)
  113. BackdropRightside.Position = UDim2.new(0,0,0,0)
  114. BackdropRightside.Parent = RightFrame
  115. local BRF = Instance.new("Frame")
  116. BRF.Size = UDim2.new(.968, 0, 0.894, 0)
  117. BRF.Position = UDim2.new(0.016, 0, 0.106, 0)
  118. BRF.BackgroundTransparency = 1
  119. BRF.Parent = BackdropRightside
  120. local UIG = Instance.new("UIGridLayout")
  121. UIG.CellPadding = UDim2.new(0, 0, 0.01, 0)
  122. UIG.CellSize = UDim2.new(0.5, 0, 0.32, 0)
  123. UIG.FillDirection = Enum.FillDirection.Horizontal
  124. UIG.Parent = BRF
  125. local InitialPrice = 10
  126. for i = 1, 6 do
  127. local NewImage = Img("ImageLabel", Data.IconBG)
  128. NewImage.Parent = BRF
  129. NewImage.Name = "Box"..i
  130. local Price = Img("ImageButton", Data.IconBG)
  131. Price.Size = UDim2.new(0.463, 0, 0.306, 0)
  132. Price.Position = UDim2.new(0.264, 0, 0.593, 0)
  133. Price.Parent = NewImage
  134. Price.Name = "PriceBackGround"
  135. local Top = Price:Clone()
  136. Top.Parent = NewImage
  137. Top.Name = "Price"
  138. Top.ZIndex = 10
  139. Top.ImageTransparency = 1
  140. local MoneyIcon = Img("ImageLabel", Data.Icon)
  141. MoneyIcon.Size = UDim2.new(0.392, 0, 1, 0)
  142. MoneyIcon.Position = UDim2.new(-0.005, 0, -0.018, 0)
  143. MoneyIcon.Parent = Top
  144. MoneyIcon.Name = "MonIc"
  145. local TextPrice = Instance.new("TextLabel")
  146. TextPrice.Text = 0
  147. TextPrice.TextSize = 30
  148. TextPrice.Font = Enum.Font.Garamond
  149. TextPrice.Size = UDim2.new(1.585, 0, 1, 0)
  150. TextPrice.Position = UDim2.new(0.979, 0, 0, 0)
  151. TextPrice.Parent = MoneyIcon
  152. TextPrice.BackgroundTransparency = 1
  153. TextPrice.Name = "TPrice"
  154. TextPrice.TextXAlignment = Enum.TextXAlignment.Left
  155. TextPrice.Text = InitialPrice
  156. TextPrice.TextScaled = true
  157. InitialPrice = InitialPrice * 10
  158. end
  159. BRF.Box1.Price.MouseButton1Click:Connect(function()
  160. print("hi")
  161. print(Amount.Text- BRF.Box1.Price.MonIc.TPrice.Text) --print()
  162. print(Amount.Text >= BRF.Box1.Price.MonIc.TPrice.Text)
  163. if Amount.Text- BRF.Box1.Price.MonIc.TPrice.Text > -1 then
  164. Amount.Text = Amount.Text - BRF.Box1.Price.MonIc.TPrice.Text
  165. BRF.Box1.Price.MonIc.TPrice.Text = BRF.Box1.Price.MonIc.TPrice.Text * 2
  166. wait()
  167. spawn(function()
  168. while wait(BoxOneDelay) do
  169. addpoints(Amount, 1)
  170. end
  171. end)
  172. ClickAmount = ClickAmount + 2
  173. end
  174. end)
  175. BRF["Box".."2"].Price.MouseButton1Click:Connect(function()
  176. print("hi")
  177. local Num = 2
  178. print(Amount.Text- BRF["Box"..Num].Price.MonIc.TPrice.Text) --print()
  179. print(Amount.Text >= BRF["Box"..Num].Price.MonIc.TPrice.Text)
  180. if Amount.Text- BRF["Box"..Num].Price.MonIc.TPrice.Text > -1 then
  181. Amount.Text = Amount.Text - BRF["Box"..Num].Price.MonIc.TPrice.Text
  182. BRF["Box"..Num].Price.MonIc.TPrice.Text = BRF["Box"..Num].Price.MonIc.TPrice.Text * 2
  183. wait()
  184. spawn(function()
  185. while wait(BoxTwoDelay) do
  186.  
  187. addpoints(Amount, 5)
  188. end
  189. end)
  190. ClickAmount = ClickAmount + 2
  191. end
  192. end)
  193. end
  194.  
  195. --[[
  196. MainBG.Size = UDim2.new(0.376, 0, 0.666, 0)
  197. MainBG.Position = UDim2.new(0.131, 0, 0.229, 0)
  198. --]]
  199. return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement