Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Me = game.Players.LocalPlayer
- local Abilities = Me:WaitForChild('AbilityFolder')
- local Equipped = Abilities:WaitForChild('Equipped')
- local ls = Me:WaitForChild('leaderstats')
- local gold = ls:WaitForChild('Gold')
- local BuyID = 367106572
- local EquipID = 375688656
- local EquippedID = 375693510
- function isOnMobile()
- return game:GetService('UserInputService').TouchEnabled
- end
- if isOnMobile() then
- script.Parent:WaitForChild('MobileAds').Visible = true
- end
- local mobileAd = script.Parent:WaitForChild('MobileAds')
- local PremiumShop = script.Parent:WaitForChild('PremiumShop')
- local Gems = PremiumShop:WaitForChild("Gems")
- local GemsFrame = PremiumShop:WaitForChild("GemsFrame")
- local Gold = PremiumShop:WaitForChild("Gold")
- local GoldFrame = PremiumShop:WaitForChild("GoldFrame")
- local Membership = PremiumShop:WaitForChild("Membership")
- local MembershipFrame = PremiumShop:WaitForChild("MembershipFrame")
- local Shop = script.Parent:WaitForChild('Shop')
- local Items = Shop:WaitForChild('ScrollingFrame')
- local Purchase = Shop:WaitForChild('Purchase')
- local itemDesc = Shop:WaitForChild('Desc')
- local itemPrice = Shop:WaitForChild('Price')
- local Menu = script.Parent:WaitForChild('Menu')
- local MenuOpen = Menu:WaitForChild('Open')
- local PremiumOpen = Menu:WaitForChild('Premium')
- local ShopOpen = Menu:WaitForChild('Shop')
- local SpectateOpen = Menu:WaitForChild('Spectate')
- local InfoOpen = Menu:WaitForChild('Info')
- --OPENING GUIS
- local menuOpen = false
- local premOpen = false
- local shopOpen = false
- itmbtn = nil
- function MenuOpening()
- if menuOpen == false then
- Menu:TweenPosition(UDim2.new(1, -400, 1, -60), "Out", "Quad", 0.75, true)
- elseif menuOpen == true then
- Menu:TweenPosition(UDim2.new(1, -75, 1, -60), "Out", "Quad", 0.75, true)
- PremiumShop:TweenPosition(UDim2.new(0.5, -100, 1.5, -150), "Out", "Quad", 0.75, true)
- Shop:TweenPosition(UDim2.new(0.5, -175, 1.5, -125), "Out", "Quad", 0.75, true)
- premOpen = false
- end
- menuOpen = not menuOpen
- end
- function PremiumOpening()
- if premOpen == false then
- PremiumShop:TweenPosition(UDim2.new(0.5, -100, 0.5, -150), "Out", "Quad", 0.75, true)
- elseif premOpen == true then
- PremiumShop:TweenPosition(UDim2.new(0.5, -100, 1.5, -150), "Out", "Quad", 0.75, true)
- end
- premOpen = not premOpen
- end
- function ShopOpening()
- if shopOpen == false then
- Shop:TweenPosition(UDim2.new(0.5, -175, 0.5, -125), "Out", "Quad", 0.75, true)
- elseif shopOpen == true then
- Shop:TweenPosition(UDim2.new(0.5, -175, 1.5, -125), "Out", "Quad", 0.75, true)
- end
- shopOpen = not shopOpen
- end
- --ADVERTISEMENTS
- function ShowAd()
- game:GetService('UserInputService').ModalEnabled = true
- game:GetService('AdService'):ShowVideoAd()
- end
- function AdDone(Played)
- game:GetService('UserInputService').ModalEnabled = false
- if Played then
- Gold.Value = Gold.Value + 2
- end
- end
- --BUTTONZ
- for i,q in pairs(Items:GetChildren()) do
- if q:IsA('ImageButton') then
- q.MouseButton1Click:connect(function(asd)
- Purchase.Item.Value = q.Item.Value
- Purchase.Chosen.Value = q.Name
- itemDesc.Text = q.Description.Value
- itemPrice.Text = q.Price.Value
- Purchase.Visible = true
- local itm = Abilities:findFirstChild(q.Item.Value)
- if itm and itm.Value == true and Equipped.Value ~= itm.Name then
- Purchase.Image = 'rbxassetid://'..EquipID
- else if itm and itm.Value == true and Equipped.Value == itm.Name then
- Purchase.Image = 'rbxassetid://'..EquippedID
- else if itm and itm.Value == false then
- Purchase.Image = 'rbxassetid://'..BuyID
- end
- end end end)
- end
- end
- function BuyEquip()
- for i,s in pairs(Items:GetChildren()) do
- if s:IsA('ImageButton') and s.Item.Value == Purchase.Item.Value then
- itmbtn = s
- end
- end
- local priceTag = itmbtn:findFirstChild('Price')
- local price = priceTag.Value
- local ab = Abilities:findFirstChild(Purchase.Item.Value)
- if Purchase.Image == 'rbxassetid://'..EquipID and ab and ab.Value == false then
- Equipped.Value = Purchase.Item.Value
- Purchase.Image = 'rbxassetid://'..EquippedID
- elseif Purchase.Image == 'rbxassetid://'..EquippedID and ab and ab.Value == true then
- Equipped.Value = ''
- elseif Purchase.Image == 'rbxassetid://'..BuyID then
- if price and gold.Value >= price and ab and ab.Value == false then
- gold.Value = gold.Value - itmbtn.Price.Value
- ab.Value = true
- Purchase.Image = 'rbxassetid://'..EquipID
- end
- end
- end
- MenuOpen.MouseButton1Click:connect(MenuOpening)
- PremiumOpen.MouseButton1Click:connect(PremiumOpening)
- ShopOpen.MouseButton1Click:connect(ShopOpening)
- Purchase.MouseButton1Click:connect(BuyEquip)
- mobileAd.MouseButton1Click:connect(ShowAd)
- game:GetService('AdService').VideoAdClosed:connect(AdDone)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement