Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --// Get Basic Items
- local ShopFrame = script.Parent
- local SkinsSection = script.Parent.SkinsSection
- local GampassSection = script.Parent.GampassSection
- local EarnCashEvent = game.ReplicatedStorage.ServerEvents:FindFirstChild("EarnCash")
- local SkinsModule = require(game.ReplicatedStorage.Modules:FindFirstChild("Skins"))
- local InventoryGui = script.Parent.Parent.Parent:WaitForChild("InventoryGui")
- local PlayersCash
- --// Get Skin Items
- local Skin1 = SkinsSection.SkinOne
- local Skin2 = SkinsSection.SkinTwo
- local Skin3 = SkinsSection.SkinThree
- local Skin1Text = Skin1.TextLabel
- local Skin2Text = Skin2.TextLabel
- local Skin3Text = Skin3.TextLabel
- local Price1 = Skin1.PriceLabel
- local Price2 = Skin2.PriceLabel
- local Price3 = Skin3.PriceLabel
- --// Get Gamepass Items
- local Gamepass1 = GampassSection.CustomNamesPass
- local Gamepass2 = GampassSection.BlankPass1
- local Gamepass3 = GampassSection.BlankPass2
- --// Setup Skin Shop
- --//Daily Skins Set-up
- local DailySkin1 = SkinsModule.Null
- local DailySkin2 = SkinsModule.MBGuy
- local DailySkin3 = SkinsModule.MBGirl
- --// Set up Skin 1
- Skin1.Image = DailySkin1.Decal
- Skin1Text.Text = DailySkin1.Name
- Price1.Text = "$"..DailySkin1.Price
- --// Set up Skin 2
- Skin2.Image = DailySkin2.Decal
- Skin2Text.Text = DailySkin2.Name
- Price2.Text = "$"..DailySkin2.Price
- --// Set up Skin 3
- Skin3.Image = DailySkin3.Decal
- Skin3Text.Text = DailySkin3.Name
- Price3.Text = "$"..DailySkin3.Price
- --// Purchasing skins
- --// Purchase Skin Function
- local function PurchaseSkin(SkinImage, SkinName)
- local InventoryNotification = script.Parent.Parent.Parent.Topbar.TopbarContainer.Inventory.IconButton.Notification
- local InvExample = InventoryGui.MainFrame.Example
- local InventoryItem = InvExample:Clone()
- InventoryItem.Parent = InventoryGui.MainFrame.ScrollingFrame
- InventoryItem.Visible = true
- InventoryItem.Name = SkinName
- InventoryItem.Image = SkinImage
- InventoryItem.TextLabel.Text = SkinName
- InventoryNotification.Visible = true
- InventoryNotification.Amount.Value.Value = InventoryNotification.Amount.Value.Value + 1
- InventoryNotification.Amount.Text = InventoryNotification.Amount.Value.Value
- if InventoryNotification.Amount.Value.Value >= 99 then
- InventoryNotification.Amount.Text = "99+"
- end
- end
- --// Purchasing Item
- Skin1.MouseButton1Click:Connect(function()
- PlayersCash = game.Players.LocalPlayer.PlayerValues.Cash.Value
- if PlayersCash <= SkinsModule.Null.Price then return end
- PurchaseSkin(Skin1.Image, Skin1Text.Text)
- EarnCashEvent:FireServer(DailySkin1.Price)
- end)
- Skin2.MouseButton1Click:Connect(function()
- PlayersCash = game.Players.LocalPlayer.PlayerValues.Cash.Value
- if PlayersCash <= SkinsModule.MBGuy.Price then return end
- PurchaseSkin(Skin2.Image, Skin2Text.Text)
- EarnCashEvent:FireServer(DailySkin2.Price)
- end)
- Skin3.MouseButton1Click:Connect(function()
- PlayersCash = game.Players.LocalPlayer.PlayerValues.Cash.Value
- if PlayersCash <= SkinsModule.MBGirl.Price then return end
- PurchaseSkin(Skin3.Image, Skin3Text.Text)
- EarnCashEvent:FireServer(DailySkin3.Price)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement