Advertisement
4zx16

Gamepass/Group Rank Door (Gamepass/Group)

Feb 27th, 2022 (edited)
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.99 KB | Source Code | 0 0
  1. --[[
  2.  || πŸ“œ AUTHOR: @4zx16 || GAMEPASS AND GROUP RANK DOOR || ONLY CHANGE ID AND GROUP AND RANK.
  3. ]]
  4. local MPS = game:GetService('MarketplaceService')
  5. local id = 0
  6. local Group = 0
  7. local RankInGroup = 0
  8.  
  9. local function onTouched(hit)
  10.     local player = game.Players:GetPlayerFromCharacter(hit.Parent)
  11.     local Timeout = false
  12.     local Door = script.Parent
  13.  
  14.     if player ~= nil and Timeout == false then
  15.         if MPS:UserOwnsGamePassAsync(player.UserId, id) then
  16.             Timeout = true
  17.             Door.CanCollide = false
  18.             Door.Transparency = 0.7
  19.             wait(1)
  20.             Timeout = false
  21.             Door.CanCollide = true
  22.             Door.Transparency = 0
  23.         elseif player:GetRankInGroup(Group) >= RankInGroup and Timeout == false then   
  24.             Timeout = true
  25.             Door.CanCollide = false
  26.             Door.Transparency = 0.7
  27.             wait(1)
  28.             Timeout = false
  29.             Door.CanCollide = false
  30.             Door.Transparency = 0
  31.         else
  32.             player.Character:BreakJoints()
  33.             MPS:PromptGamePassPurchase(player, id)
  34.         end
  35.     end
  36. end
  37. script.Parent.Touched:Connect(onTouched)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement