Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local module = {}
- function Tween(SizeChange, PositionChange, Parent)
- local TweenService = game:GetService("TweenService")
- local Info = TweenInfo.new(
- .1,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local Changes = {
- Size = SizeChange,
- Position = PositionChange
- }
- local TweenOb = TweenService:Create(Parent, Info, Changes)
- return TweenOb
- end
- function TweenIt(Object, Changes)
- local TweenService = game:GetService("TweenService")
- local Info = TweenInfo.new(
- .05,
- Enum.EasingStyle.Linear,
- Enum.EasingDirection.Out,
- 0,
- false,
- 0
- )
- local TweenOb = TweenService:Create(Object, Info, Changes)
- return TweenOb
- end
- local function addpoints(Obj, ClickAmount)
- Obj.Text = tostring(tonumber(Obj.Text) + ClickAmount)
- end
- local function Img(Type, SuppliedImage)
- local Img = Instance.new(Type)
- Img.BackgroundTransparency = 1
- Img.Image = SuppliedImage
- Img.BackgroundTransparency = 1
- return Img
- end
- function module.Gui(Playergui, Data)
- local ClickAmount = 1
- local SG = Instance.new("ScreenGui")
- local BoxOneDelay = 4
- local BoxTwoDelay = 6
- SG.Parent = Playergui
- local Main = Instance.new("Frame")
- Main.Size = UDim2.new(1,0,1,0)
- Main.Parent = SG
- Main.BackgroundTransparency = 1
- Main.Name = "Main"
- local Backdrop = Img("ImageLabel", Data.Backdrop)
- Backdrop.Size = UDim2.new(1, 0, 1, 0)
- Backdrop.Position = UDim2.new(0, 0, 0, 0)
- Backdrop.Parent = Main
- Backdrop.ZIndex = -1
- local IconBg = Img("ImageLabel", Data.IconBG)
- IconBg.Position = UDim2.new(.131, 0, 0.229, 0)
- IconBg.Size = UDim2.new(0.376, 0, 0.666, 0)
- IconBg.Parent = Main
- local Button = Img("ImageButton", Data.Icon)
- Button.Parent = IconBg
- Button.Size = UDim2.new(0.34, 0, 0.359, 0)
- Button.Position = UDim2.new(0.34, 0, 0.359, 0)
- local MIC = Img("ImageLabel", Data.Icon)
- MIC.Parent = IconBg
- MIC.Name = "MoneyIcon"
- MIC.Size = UDim2.new(0.125, 0, 0.128, 0)
- MIC.Position = UDim2.new(0.188, 0, 0.109, 0)
- local Pickaxe = Img("ImageLabel", Data.SecondIcon)
- Pickaxe.Size = UDim2.new(0.25, 0,0.325, 0)
- Pickaxe.Parent = MIC.Parent
- Pickaxe.Position = UDim2.new(0.575, 0,0.375, 0)
- local Amount = Instance.new("TextLabel")
- Amount.Position = UDim2.new(.979, 0, 0, 0)
- Amount.Size = UDim2.new(4.578, 0, 1, 0)
- Amount.TextSize = 80
- Amount.Parent = MIC
- Amount.TextXAlignment = Enum.TextXAlignment.Left
- Amount.BackgroundTransparency = 1
- Amount.Font = Enum.Font.Garamond
- Amount.Text = 0
- Button.MouseButton1Click:Connect(function()
- spawn(function()
- local Tweennew = TweenIt(Pickaxe, {Rotation = -75})
- Tweennew:Play()
- Tweennew.Completed:Wait()
- local NewTween = TweenIt(Pickaxe, {Rotation = 0})
- NewTween:Play()
- end)
- local TweenPlay = Tween(UDim2.new(0.401, 0, 0.41, 0), UDim2.new(0.299, 0, 0.294, 0), Button)
- TweenPlay:Play()
- TweenPlay.Completed:Wait()
- local BackTween = Tween(UDim2.new(0.34, 0, 0.359, 0), UDim2.new(0.34, 0, 0.359, 0), Button)
- BackTween:Play()
- addpoints(Amount, ClickAmount)
- end)
- --[[
- RIGHTSIDE FRAME ----------------------------
- --]]
- local RightFrame = Instance.new("Frame")
- RightFrame.Parent = SG
- RightFrame.Size = UDim2.new(0.288, 0, 0.567, 0)
- RightFrame.Position = UDim2.new(0.506, 0, 0.328, 0)
- RightFrame.BackgroundTransparency = 1
- local BackdropRightside = Img("ImageLabel", Data.IconBG)
- BackdropRightside.Size = UDim2.new(1,0,1,0)
- BackdropRightside.Position = UDim2.new(0,0,0,0)
- BackdropRightside.Parent = RightFrame
- local BRF = Instance.new("Frame")
- BRF.Size = UDim2.new(.968, 0, 0.894, 0)
- BRF.Position = UDim2.new(0.016, 0, 0.106, 0)
- BRF.BackgroundTransparency = 1
- BRF.Parent = BackdropRightside
- local UIG = Instance.new("UIGridLayout")
- UIG.CellPadding = UDim2.new(0, 0, 0.01, 0)
- UIG.CellSize = UDim2.new(0.5, 0, 0.32, 0)
- UIG.FillDirection = Enum.FillDirection.Horizontal
- UIG.Parent = BRF
- local InitialPrice = 10
- for i = 1, 6 do
- local NewImage = Img("ImageLabel", Data.IconBG)
- NewImage.Parent = BRF
- NewImage.Name = "Box"..i
- local Price = Img("ImageButton", Data.IconBG)
- Price.Size = UDim2.new(0.463, 0, 0.306, 0)
- Price.Position = UDim2.new(0.264, 0, 0.593, 0)
- Price.Parent = NewImage
- Price.Name = "PriceBackGround"
- local Top = Price:Clone()
- Top.Parent = NewImage
- Top.Name = "Price"
- Top.ZIndex = 10
- Top.ImageTransparency = 1
- local MoneyIcon = Img("ImageLabel", Data.Icon)
- MoneyIcon.Size = UDim2.new(0.392, 0, 1, 0)
- MoneyIcon.Position = UDim2.new(-0.005, 0, -0.018, 0)
- MoneyIcon.Parent = Top
- MoneyIcon.Name = "MonIc"
- local TextPrice = Instance.new("TextLabel")
- TextPrice.Text = 0
- TextPrice.TextSize = 30
- TextPrice.Font = Enum.Font.Garamond
- TextPrice.Size = UDim2.new(1.585, 0, 1, 0)
- TextPrice.Position = UDim2.new(0.979, 0, 0, 0)
- TextPrice.Parent = MoneyIcon
- TextPrice.BackgroundTransparency = 1
- TextPrice.Name = "TPrice"
- TextPrice.TextXAlignment = Enum.TextXAlignment.Left
- TextPrice.Text = InitialPrice
- TextPrice.TextScaled = true
- InitialPrice = InitialPrice * 10
- end
- BRF.Box1.Price.MouseButton1Click:Connect(function()
- print("hi")
- print(Amount.Text- BRF.Box1.Price.MonIc.TPrice.Text) --print()
- print(Amount.Text >= BRF.Box1.Price.MonIc.TPrice.Text)
- if Amount.Text- BRF.Box1.Price.MonIc.TPrice.Text > -1 then
- Amount.Text = Amount.Text - BRF.Box1.Price.MonIc.TPrice.Text
- BRF.Box1.Price.MonIc.TPrice.Text = BRF.Box1.Price.MonIc.TPrice.Text * 2
- wait()
- spawn(function()
- while wait(BoxOneDelay) do
- addpoints(Amount, 1)
- end
- end)
- ClickAmount = ClickAmount + 2
- end
- end)
- BRF["Box".."2"].Price.MouseButton1Click:Connect(function()
- print("hi")
- local Num = 2
- print(Amount.Text- BRF["Box"..Num].Price.MonIc.TPrice.Text) --print()
- print(Amount.Text >= BRF["Box"..Num].Price.MonIc.TPrice.Text)
- if Amount.Text- BRF["Box"..Num].Price.MonIc.TPrice.Text > -1 then
- Amount.Text = Amount.Text - BRF["Box"..Num].Price.MonIc.TPrice.Text
- BRF["Box"..Num].Price.MonIc.TPrice.Text = BRF["Box"..Num].Price.MonIc.TPrice.Text * 2
- wait()
- spawn(function()
- while wait(BoxTwoDelay) do
- addpoints(Amount, 5)
- end
- end)
- ClickAmount = ClickAmount + 2
- end
- end)
- end
- --[[
- MainBG.Size = UDim2.new(0.376, 0, 0.666, 0)
- MainBG.Position = UDim2.new(0.131, 0, 0.229, 0)
- --]]
- return module
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement