I am trying to make a door that only allows people with a gamepass (or group rank above a specific amount) to be able to go through it. What would be the best method to do this? Making the door CanCollide is very inefficient and allows other players to go through the door even if they aren’t VIP. I have tried collision groups, but these sometimes do not work for other players, especially if it is a very laggy game like the one I am trying to make a door for. I would greatly appreciate the help.
A simple door scripted with the GamepassID, if the player has the game pass then the door will be set to canCollide=false for like 0.5 seconds so he can get through, but there’s many methods.
In toolbar try searching “Gamepass Door”
I have tried that, people without a gamepass can still get into the area.
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
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.
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.
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.
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