Want to make more efficiently vip door

Hello develupers I maked a vip door that’s work if the player touches in then and he have the gamepass the part is set to canColide = false but the player that not have the gamepass try to enter and in same time a player if has the pass enter the player that not has the pass can enter. Then I want to change this script

to create a colision group for the players if have or no the pass. Sorry for use images I can’t put scripts on phone.

When using waits, use task.wait() as wait() is deprecated / should not be used for new work.

As for collision groups, please look at the dev forum for collision groups.
Collision Filtering (roblox.com)
Player Collision Group - Help and Feedback / Scripting Support - DevForum | Roblox

1 Like

But how to make a colision group if the player has the pass?

You can make a collision group by running the command

local PhysicsService = game:GetService("PhysicsService")

and you can set parts in a collision group by doing

PhysicsService:SetPartCollisionGroup(workspace.Part1, "VipPlayers")
PhysicsService:SetPartCollisionGroup(workspace.Part2, "NonVipPlayers")
1 Like