Advertisement
4zx16

Chat Command (Gamepass)

Nov 12th, 2021 (edited)
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.64 KB | None | 0 0
  1. --[[
  2.  || 📜 AUTHOR: @4zx16 || GAMEPASS COMMAND
  3. ]]
  4. local Command = {} -- Commands go here
  5. local MPS = game:GetService("MarketplaceService")
  6. local id = 0 -- Your Gamepass Id Goes Here
  7.  
  8. game.Players.PlayerAdded:Connect(function(player)
  9.     player.Chatted:Connect(function(msg)
  10.        
  11.         for _, GamepassChatCommand in pairs(Command) do
  12.             if msg:sub(1, GamepassChatCommand:len()):lower() == GamepassChatCommand:lower() then
  13.                 if MPS:UserOwnsGamePassAsync(player.UserId, id) then
  14.                     wait(0.9)
  15.                     print(player.Name.. " used the command")
  16.                 else
  17.                     wait(0.9)
  18.                     MPS:PromptGamePassPurchase(player, id)
  19.                 end
  20.             end
  21.         end
  22.     end)
  23. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement