May contain errors, I based this off of a VipDoorScript for a GamePassID when I was a noob.
09 | Serv = game:GetService( "BadgeService" ) |
10 | MServ = game:GetService( "MarketplaceService" ) |
15 | print ( "Players Created" ) |
16 | elseif not _G.Players [ GroupID ] then |
17 | _G.Players [ GroupID ] = { } ; |
18 | print ( "Players.Pass created" ) |
21 | Table = _G.Players [ PassOrShirtID ] |
23 | function CheckPlayer(player 2 ) |
25 | if Table [ i ] = = player 2 then |
32 | Door.Touched:connect( function (hit) |
33 | if game.Players:GetPlayerFromCharacter(hit.Parent) then |
34 | player = game.Players:GetPlayerFromCharacter(hit.Parent) |
35 | if Serv:UserHasBadge(player.userId,PassOrShirtID) or CheckPlayer(player) then |
36 | Door.CanCollide = false ; Door.Transparency = 0.5 ; |
38 | Door.CanCollide = true ; Door.Transparency = 0 ; |
41 | MServ:PromptPurchase(player,PassOrShirtID) |
42 | h = player.Character:FindFirstChild( "Humanoid" ) |
43 | if h then h.WalkSpeed = 0 end |
45 | con = MServ.PromptPurchaseFinished:connect( function (ply,asset,purch) |
46 | if ply = = player and asset = = GroupID then |
49 | if h then h.WalkSpeed = 16 end |
50 | table.insert(Table,player) |
52 | player.Character:BreakJoints() |
57 | player.Character:BreakJoints() |
I hope it works. Like I mentioned above, it is based off of a VIP Shirt door, so it may not work accurately. Best of luck!