Best method for a gamepass-only door?

You can try setting it to 0.5 seconds or even less .

How do they get in? Glitching? Going in when someone with a gamepass gets through the door?

Yes, my door is very large meaning that if somebody was going in on the left side of the door, people without the gamepass can get through the right side.

Using CollisionGroups would allow you to specify a group of players that can pass these doors as if they aren’t there, while allowing no other players through. The actual collision property of the door doesn’t change at all.

I understand that, that is why I assigned the collisiongroup only to people who owned the gamepass. It worked, but some players were not able to go through the door even if they owned the gamepass.

Could you specify the code you used for this? In theory it should work as desired, so there may be a problem with the execution.

Yesterday I made a post which received a great amount of replies (0).
(with the script)

The easiest way is just doing this on the client. Check if they have it and then keep it open as it’ll only replicate for them.

Because of an exploit issue, make sure everything inside can only be activated by those with the gamepass. (check on server)

If collisions do not work, you can try and add a normal door that everyone can walk through but says your gamepass on it like VIP. The floor of that room can be like a teleporter that teleports anyone that doesn’t have the gamepass out but allows people with it to stay in there. By making the floor/teleporter large enough, this will ensure people can not in through glitches.

I hope that solves your problem :smile:

I have already done this before, it was too glitchy for players.

If that does not work, then you can use a UI button that only appears if the player has the gamepass. That button will teleport them to the VIP room. However, the button will not be there if they do not own the gamepass.

1 Like

Inside the client (on a local script) check if the player has the gamepass.

If they do, set the cancollide to false. Only that player will be able to enter the door and there will be no chance of anyone else getting through as it’s closed for them.

I just did this,

local MarketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamepassId = 6318668
script.Parent.Touched:Connect(function(char)
	if MarketPlaceService:PlayerOwnsAsset(player, gamepassId) or player:GetRankInGroup(4837748) >= 3 then
		script.Parent.CanCollide = false
	end
end)

but it doesn’t seem to work. No errors.

Gamepasses use UserOwnsGamepassAsync, not PlayerOwnsPass.

Also use their userId, and not the instance.

local MarketPlaceService = game:GetService("MarketplaceService")
local player = game.Players.LocalPlayer
local gamepassId = 6318668

if MarketPlaceService:UserOwnsGamepassAsync(player.UserId, gamepassId) or player:GetRankInGroup(4837748) >= 3 then
	script.Parent.CanCollide = false
end

Try that. You don’t need to check if they touched the door because only they will be affected by the change.

3 Likes

CollisionGroups, hands down.

That’s a problem with your implementation then. CollisionGroups are perfectly fine for accomplishing tasks like this. Fixes are being sent to you via that thread so make sure to maintain that thread.

You don’t need to use collision groups, you can just use local scripts.

You’ve made that apparent. I prefer to use CollisionGroups mostly because of server-side control of collision filtering per player and it helps for various processes that I run in tandem with the server which won’t do if the client is the one setting collisions.

Keep in mind that locally-set collision doesn’t replicate to the server and it deems it as CanCollide true for all users. If you have processes running in the server that are related to collisions, it’ll treat all users as having walked through a CanCollide part.

You can also set up a filter function to void users who should be able to pass through something but I feel that’s reinventing the wheel when a service dedicated to collision filtering already exists.

1 Like

Within your script, you should also check to see if unwelcomed players glitched past the door. Within games that use R6 avatars, there is a common glitch where players will make their character face a corner of a part, have their camera look away from the corner, and then zoom in while trying to walk towards the corner, allowing them to glitch through the part.

This glitch is harder to do using an R15 character, but it’s still possible. If there are unwelcomed players within the game-pass room, then you can teleport them outside the room (or somewhere farther away to discourage them from trying to glitch in again).

Just a thought :slight_smile:

I used a new script that just teleports the character, my game is R15 only and most of the corners are too thick to be glitched through. Thanks for the advice however, I am currently trying to detect if that happens

There are many ways of detecting if a player is within a certain area.

To keep it simple, you could simply make a hit part and use the .Touched event.

I know exactly what you’re talking about. There is a workaround for this case, luckily. It allows for only the owner of the gamepass to pass through, and it keeps those who don’t have the pass from entering. It does not deal with any direct collision configurations nor any “wait” timers.

Try my game below. It is free to copy/take. Enjoy, and I hope that this answers your question!

(Also, make sure you rejoin after you buy the 1R$ gamepass, or else it’ll prompt you to buy it again for some reason.)

1 Like