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.
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
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
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)
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)
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,
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.