Advertisement
4zx16

GUI Handler (Gamepass)

Nov 6th, 2021 (edited)
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || GAMEPASS GUI HANDLER || SELL GUIs USING GAMEPASSES.
  3. ]]
  4. local MPS = game:GetService("MarketplaceService")
  5. local gui = game:GetService("ReplicatedStorage").Name
  6. local RS = game:GetService("ReplicatedStorage")
  7. local id = 0
  8.  
  9. game.Players.PlayerAdded:Connect(function(player)
  10.     if MPS:UserOwnsGamePassAsync(player.UserId, id) then
  11.         wait(1)
  12.         gui:Clone().Parent = player:WaitForChild("PlayerGui")
  13.     else
  14.         print("Player doesn't own the Gamepass!")
  15.     end
  16. end)
  17. RS.GUI.OnServerEvent:Connect(function(plr)
  18.     if MPS:UserOwnsGamePassAsync(plr.UserId, id) then
  19.         wait(1)
  20.         gui:Clone().Parent = plr:WaitForChild("PlayerGui")
  21.     end
  22. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement