Help with making a gamepass door

Hello,

I want to make a gamepass door. But the problem is that I don’t know how to. Theres a specific way I want to make one.

What I want to make

As I said I want to make a gamepads door. I want it to turn to .6 in transparency and can collide false. I want it so the second you join the game it happens instead of walking close to it then it will do that. I also want to make that this only happens when you have the gamepass. If a person with the gamepass walks through the block and its transparency is .6 and can collide false, a person who’s there at the same time won’t see any of that. Just the person walking through.

What I have tried

I tried to look at tutorials but I’m afraid those cant go into specifics. I looked on the wiki, asked friends and other builders but they don’t know or they haven’t seen my message.

I hope you can help me!

From,
Mista

3 Likes

Do you need help building a gamepass door or scripting? Because it sounds like it’s more on the scripting side of things. Use #help-and-feedback:scripting-support instead

oh ok. Sorry I was a bit confused!

yeah it was before. I changed it…Didnt want to get flagged :stuck_out_tongue:

I have a gamepass door script, want me to share?

An idea would be to client-sidedly allow the door to be collidable to only gamepass owners, so non-gamepass owners can’t get through.

-- StarterPlayerScripts

local Player = game:GetService('Players').LocalPlayer
local MarketplaceService = game:GetService('MarketplaceService')

local passId = 00000
local door = workspace.Part

if MarketplaceService:UserOwnsGamePassAsync(Player.UserId,passId) then
    door.Transparency = 0.6
    door.CanCollide = false
end

Hope this helps!

try using :FireClient for this after checking if they have the gamepass. Check it here

Heres the code

put it on the door

local PassID = 0 --put in the gamepass id

game.Players.PlayerAdded:Connect(function(player)
	
	local UserOwnsGamePass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, PassID)
	
	script.Parent.Touched:Connect(function()
		
		
		if UserOwnsGamePass then
            script.Parent.Transparency = 0.6
			script.Parent.CanCollide = false
		else
            script.Parent.Transparency = 1
			script.Parent.CanCollide = true
		end
		
	end)
	
end)
2 Likes

sure. I would love to see it if it helps!

I have already put it up. Tell me if i should edit it for certant things that you would like. :slight_smile: im glad i can help!

Hey ummmmm…You have to touch the door for it to be invisible(.6). can you make it so that it turns to .6 when you start to play?

thanks,
Mista

Here you go, Tell me if i should do anything else :slight_smile:

local PassID = 0 --put in the gamepass id

script.Parent.Transparency = 0.6

game.Players.PlayerAdded:Connect(function(player)
	
	local UserOwnsGamePass = game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, PassID)
	
	script.Parent.Touched:Connect(function()
		
		
		if UserOwnsGamePass then
			script.Parent.CanCollide = false
		else
			script.Parent.CanCollide = true
		end
		
	end)
	
end)

Hi,

does the script make it so people who don’t have the gamepass cant see if this is invisible(And its can collide is going to be true)?

From,
Mista

People who dont have the gamepass cant pass, but can see it as 0.6 transperency.

oh. can u try and make it so they cant see its transparency? Sorry for the trouble! Im not very good at scripting.

I want to make it so they don’t get confused. I don’t want them to think that its translucent so they can enter.

I am sorry, but i do not think that is possible or i am just not capable of scripting that.
You can try contacting a better scripter, or just take it as it is,

Many regards,
Bonejon

1 Like

Ok. I will take it as it is. Thank you so much!

also I have a question. maybe you can do it. Maybe this will help you get started. You don’t have to try again. But here: Think about this. You know how you made it so that people cant enter if they have the gamepass? Because it will make it can collide true? Maybe you can try to make a similar statement but making it so they can only see it as its transparency as 0. This probably won’t change anything though.

From,
Mista

I can make it change to a brick when a non gamepass player touches it, but everyone will see it including gamepass players,

From,
Bonejon