This is all running in a Module script.
local Player = game:GetService("Players").LocalPlayer
local TweenService = game:GetService("TweenService")
local GamePassService = game:GetService("GamePassService")
local MarketPlaceService = game:GetService("MarketplaceService")
local PlayerGui = Player.PlayerGui
local StorePasses = PlayerGui.RespawnScripts.Store.Passes
local ClientHandler = PlayerGui.RespawnScripts.ClientHandler
local FeatureProducts = PlayerGui.RespawnScripts.Store.Featured
local Store = {}
Store.GamePasses = {
{"VIP", 767141329},
{"Employee", 766502399}
}
Store.Products = {
{"Pin", 17002684973}
}
Store.Donations = { }
for i,v in pairs(Store.GamePasses) do
StorePasses[v.Name].Purchase.MouseEnter:Connect(function(MouseEnter)
ClientHandler.Hover:Play()
local Info = TweenInfo.new(0.15, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(StorePasses[v.Name].Purchase, Info, {BackgroundColor3 = Color3.fromRGB(147, 117, 87),}):Play() Info = nil
end)
StorePasses[v.Name].Purchase.MouseButton1Down:Connect(function(MouseButton)
ClientHandler.Hover:Play() ClientHandler.ClickSound2:Play()
MarketPlaceService:PromptGamePassPurchase(Player ,Store.GamePasses[v.Name])
end)
StorePasses[v.Name].MouseLeave:Connect(function(MouseLeave)
local Info = TweenInfo.new(0.15, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(StorePasses[v.Name].Purchase, Info, {BackgroundColor3 = Color3.fromRGB(161, 128, 95),}):Play() Info = nil
end)
end
for i, v in pairs(Store.Products) do
FeatureProducts[v.Name].Purchase.MouseEnter:Connect(function(MouseEnter)
ClientHandler.Hover:Play()
local Info = TweenInfo.new(0.15, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(FeatureProducts[v.Name].Purchase, Info, {BackgroundColor3 = Color3.fromRGB(147, 117, 87),}):Play() Info = nil
end)
FeatureProducts[v.Name].Purchase.MouseButton1Down:Connect(function(MouseButton)
ClientHandler.Hover:Play() ClientHandler.ClickSound2:Play()
MarketPlaceService:PromptProductPurchase(Player ,Store.Products[v.Name])
end)
FeatureProducts[v.Name].Purchase.MouseLeave:Connect(function(MouseLeave)
local Info = TweenInfo.new(0.15, Enum.EasingStyle.Cubic, Enum.EasingDirection.Out, 0, false, 0)
TweenService:Create(FeatureProducts[v.Name].Purchase, Info, {BackgroundColor3 = Color3.fromRGB(161, 128, 95),}):Play() Info = nil
end)
end
return Store