Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 8 years ago
Edited by BlueTaslem 8 years ago

Please make your question title relevant to your question content. It should be a one-sentence summary in question form.
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.

0
Edited to use Lua code block BlueTaslem 18071 — 8y

1 answer

Log in to vote
0
Answered by
funzrey 58
8 years ago

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.

Ad

Answer this question