Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Can u check out this please? It's imporatnt and I need help :/

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

0

Edited to use Lua code block

1 answer

I think ROBLOX's gamepass server isn't working, but it may be your code. 16:39:50.865 - Game passes can only be queried by a Script running on a ROBLOX game server Seems like you're using a LocalScript instead of a server script, If you are using a server script, test it in the actual game with friends who haven't bought the gamepass.

Tell me if you need any more help, ALSO. Format your questions with the Lua code block so that it's easier to read & understand.

This discussion is preserved as it was. New answers, comments, and votes are closed.