local GamePassService= game:GetService('GamePassService')
local GamePassID= 446548720 --ID of gamepass
local debounce=true
script.Parent.Touched:connect(function(Hit)
--If all of these are true...
if Hit and Hit.Parent and Hit.Parent:FindFirstChild("Humanoid") then
local player=game.Players:GetPlayerFromCharacter(Hit.Parent)
if player and debounce then
if GamePassService:PlayerHasPass(player,GamePassID)or player.Name== "Kikiii14" or "JeanClownVanDamn" or "enzo90" then
debounce=false
script.Parent.Transparency=0.5
script.Parent.CanCollide=false
wait (5)
script.Parent.CanCollide=true
script.Parent.Transparency=0
debounce=true
end
end
end
end)
What's working:
The door will open and close as it is supposed to.
What's not working:
Anyone can enter the room for some reason, no matter if they have the game pass or are of the names of the players listed, or not.
Message:
16:39:50.865 - Game passes can only be queried by a Script running on a ROBLOX game server
Even so, when I start a server, anyone can still get in the room.
I'm wondering why this is? I could just use the Roblox Set Gamepass door, but really, that's not very fun. I need to figure this out myself.
Thanks.

1 comment
Edited to use Lua code block