Advertisement
Trioxide

Untitled

Mar 1st, 2016
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.72 KB | None | 0 0
  1. local Me = game.Players.LocalPlayer
  2. local Abilities = Me:WaitForChild('AbilityFolder')
  3. local Equipped = Abilities:WaitForChild('Equipped')
  4. local ls = Me:WaitForChild('leaderstats')
  5. local gold = ls:WaitForChild('Gold')
  6.  
  7. local BuyID = 367106572
  8. local EquipID = 375688656
  9. local EquippedID = 375693510
  10.  
  11. function isOnMobile()
  12. return game:GetService('UserInputService').TouchEnabled
  13. end
  14.  
  15. if isOnMobile() then
  16. script.Parent:WaitForChild('MobileAds').Visible = true
  17. end
  18.  
  19. local mobileAd = script.Parent:WaitForChild('MobileAds')
  20.  
  21. local PremiumShop = script.Parent:WaitForChild('PremiumShop')
  22. local Gems = PremiumShop:WaitForChild("Gems")
  23. local GemsFrame = PremiumShop:WaitForChild("GemsFrame")
  24. local Gold = PremiumShop:WaitForChild("Gold")
  25. local GoldFrame = PremiumShop:WaitForChild("GoldFrame")
  26. local Membership = PremiumShop:WaitForChild("Membership")
  27. local MembershipFrame = PremiumShop:WaitForChild("MembershipFrame")
  28.  
  29. local Shop = script.Parent:WaitForChild('Shop')
  30. local Items = Shop:WaitForChild('ScrollingFrame')
  31. local Purchase = Shop:WaitForChild('Purchase')
  32. local itemDesc = Shop:WaitForChild('Desc')
  33. local itemPrice = Shop:WaitForChild('Price')
  34.  
  35. local Menu = script.Parent:WaitForChild('Menu')
  36. local MenuOpen = Menu:WaitForChild('Open')
  37. local PremiumOpen = Menu:WaitForChild('Premium')
  38. local ShopOpen = Menu:WaitForChild('Shop')
  39. local SpectateOpen = Menu:WaitForChild('Spectate')
  40. local InfoOpen = Menu:WaitForChild('Info')
  41.  
  42. --OPENING GUIS
  43.  
  44. local menuOpen = false
  45. local premOpen = false
  46. local shopOpen = false
  47. itmbtn = nil
  48.  
  49. function MenuOpening()
  50. if menuOpen == false then
  51. Menu:TweenPosition(UDim2.new(1, -400, 1, -60), "Out", "Quad", 0.75, true)
  52. elseif menuOpen == true then
  53. Menu:TweenPosition(UDim2.new(1, -75, 1, -60), "Out", "Quad", 0.75, true)
  54. PremiumShop:TweenPosition(UDim2.new(0.5, -100, 1.5, -150), "Out", "Quad", 0.75, true)
  55. Shop:TweenPosition(UDim2.new(0.5, -175, 1.5, -125), "Out", "Quad", 0.75, true)
  56. premOpen = false
  57. end
  58. menuOpen = not menuOpen
  59. end
  60.  
  61. function PremiumOpening()
  62. if premOpen == false then
  63. PremiumShop:TweenPosition(UDim2.new(0.5, -100, 0.5, -150), "Out", "Quad", 0.75, true)
  64. elseif premOpen == true then
  65. PremiumShop:TweenPosition(UDim2.new(0.5, -100, 1.5, -150), "Out", "Quad", 0.75, true)
  66. end
  67. premOpen = not premOpen
  68. end
  69.  
  70. function ShopOpening()
  71. if shopOpen == false then
  72. Shop:TweenPosition(UDim2.new(0.5, -175, 0.5, -125), "Out", "Quad", 0.75, true)
  73. elseif shopOpen == true then
  74. Shop:TweenPosition(UDim2.new(0.5, -175, 1.5, -125), "Out", "Quad", 0.75, true)
  75. end
  76. shopOpen = not shopOpen
  77. end
  78.  
  79. --ADVERTISEMENTS
  80.  
  81. function ShowAd()
  82. game:GetService('UserInputService').ModalEnabled = true
  83. game:GetService('AdService'):ShowVideoAd()
  84. end
  85.  
  86. function AdDone(Played)
  87. game:GetService('UserInputService').ModalEnabled = false
  88. if Played then
  89. Gold.Value = Gold.Value + 2
  90. end
  91. end
  92.  
  93. --BUTTONZ
  94.  
  95. for i,q in pairs(Items:GetChildren()) do
  96. if q:IsA('ImageButton') then
  97. q.MouseButton1Click:connect(function(asd)
  98. Purchase.Item.Value = q.Item.Value
  99. Purchase.Chosen.Value = q.Name
  100. itemDesc.Text = q.Description.Value
  101. itemPrice.Text = q.Price.Value
  102. Purchase.Visible = true
  103. local itm = Abilities:findFirstChild(q.Item.Value)
  104. if itm and itm.Value == true and Equipped.Value ~= itm.Name then
  105. Purchase.Image = 'rbxassetid://'..EquipID
  106. else if itm and itm.Value == true and Equipped.Value == itm.Name then
  107. Purchase.Image = 'rbxassetid://'..EquippedID
  108. else if itm and itm.Value == false then
  109. Purchase.Image = 'rbxassetid://'..BuyID
  110. end
  111. end end end)
  112. end
  113. end
  114.  
  115. function BuyEquip()
  116. for i,s in pairs(Items:GetChildren()) do
  117. if s:IsA('ImageButton') and s.Item.Value == Purchase.Item.Value then
  118. itmbtn = s
  119. end
  120. end
  121. local priceTag = itmbtn:findFirstChild('Price')
  122. local price = priceTag.Value
  123. local ab = Abilities:findFirstChild(Purchase.Item.Value)
  124. if Purchase.Image == 'rbxassetid://'..EquipID and ab and ab.Value == false then
  125. Equipped.Value = Purchase.Item.Value
  126. Purchase.Image = 'rbxassetid://'..EquippedID
  127. elseif Purchase.Image == 'rbxassetid://'..EquippedID and ab and ab.Value == true then
  128. Equipped.Value = ''
  129. elseif Purchase.Image == 'rbxassetid://'..BuyID then
  130. if price and gold.Value >= price and ab and ab.Value == false then
  131. gold.Value = gold.Value - itmbtn.Price.Value
  132. ab.Value = true
  133. Purchase.Image = 'rbxassetid://'..EquipID
  134. end
  135. end
  136. end
  137.  
  138. MenuOpen.MouseButton1Click:connect(MenuOpening)
  139. PremiumOpen.MouseButton1Click:connect(PremiumOpening)
  140. ShopOpen.MouseButton1Click:connect(ShopOpening)
  141.  
  142. Purchase.MouseButton1Click:connect(BuyEquip)
  143.  
  144. mobileAd.MouseButton1Click:connect(ShowAd)
  145. game:GetService('AdService').VideoAdClosed:connect(AdDone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement