Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local mS = game:GetService("MarketplaceService")
- local shopEvent = game.ReplicatedStorage.Remotes.Shop
- local passID = script.ID.Value
- local player = game.Players.LocalPlayer
- local textLabel = script.Parent.TextLabel
- local hasPass = false
- local function Action()
- shopEvent:FireServer(passID)
- textLabel.TextColor3 = Color3.fromRGB(96,235,36)
- end
- script.Parent.MouseButton1Click:Connect(function()
- mS:PromptGamePassPurchase(player, passID)
- end)
- mS.PromptGamePassPurchaseFinished:Connect(
- function(player,id,purchased)
- if purchased and id == passID then
- Action()
- end
- end
- )
- hasPass = mS:UserOwnsGamePassAsync(player.UserId, passID)
- if hasPass == true then
- Action()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement