Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make a door that only players with a Game Pass can open?

Asked by 4 years ago

Ok, yes, I know I asked this before, but I've stopped getting views and the answer I got didn't help. So I'm just asking it again. I just need it for the following game: https://web.roblox.com/games/4420473103/Redwood-Research-Base Can anybody please help me with this?

0
I recommend that you go to the toolbox and fin a VIP door, you can copy the script from there. Just change the gamepassID to your own. Tixabel 19 — 4y
0
Yea, follow Itls you need to place VIP door and change in scipt door gamepass mrinternetbees 0 — 4y
0
We have a Problem there: I tried that but they didn't work JB_SuperGamer 165 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

Its easy. Just insert a script into your door then, Copy this

local MarketPlaceService = game:GetService("MarketplaceService")
local GamePassId = 214214897 -- Gamepass ID here.

local debounce = false

script.Parent.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        if debounce == false then
            debounce = true
            local player = game.Players:GetPlayerFromCharacter(hit.Parent)
            if MarketPlaceService:UserOwnsGamePassAsync(player.userId, GamePassId) then
                script.Parent.Transparency = 0.5 -- The visibility when it is open
                script.Parent.CanCollide = false -- Do not change or player will not be able to walk through
                wait(0.1)
                debounce = false
                wait(5) -- How long it stays open
                script.Parent.Transparency = 0 -- The true visibility of the door
                script.Parent.CanCollide = true -- Do not change or players that do not have the gamepass will be able to walk through


            end






        end
    end
end)

If the script does not work. Change the GamepassId to gamepassId

Please accept if this answer was helpful.

Ad

Answer this question