Advertisement
lucky4291

VIP Door

Jul 23rd, 2018
2,559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.76 KB | None | 0 0
  1. --Script made by lucky4291. Tutorial found here:
  2. --https://www.youtube.com/watch?v=Vdiunogj3Rk&t
  3.  
  4. local door = script.Parent
  5.  
  6. function open()
  7.     door.CanCollide = false
  8. end
  9.  
  10. function close()
  11.     door.CanCollide = true
  12. end
  13.  
  14. function get_player(part)
  15.     for _, player in ipairs(game.Players:GetPlayers()) do
  16.         if part:IsDescendantOf(player.Character) then
  17.             return player
  18.         end
  19.     end
  20. end
  21.  
  22. door.Touched:connect(function(part)
  23.     local player = get_player(part)
  24.     local character = player.Character
  25.     if not player then return end
  26.  
  27.     local allow = (
  28.         game:GetService('MarketplaceService'):UserOwnsGamePassAsync(player.userId, xxxxx) -- Paste your game pass id here
  29.     )
  30.  
  31.     if allow then
  32.         open()
  33.         delay(4, close)
  34.     else
  35.         character.Humanoid.Health = 0
  36.     end
  37. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement