0
votes

I have made a gamepass for my game and I have made a door that leads to a restricted area that you only can access with the gamepass but if someone who owns the gamepass opens the door then everyone can come in. When a new player joins they are given a boolean value that evaluates to false if the player don't own the gampass and true if they do own it. The problem is that the boolean value is put in the player that is in the player folder so when I set up a detector to check if the player owns the gamepass the touched event only gives me the information about the player that is in the workspace, and in the workspace player there is no boolean value to check if they have the pass. So somehow i need a way to find the player that is in the players folder using a touched event.

I don't really have any code to show because I didn't really think any ideas that I came up with would work and those that I did try didn't work.

1

1 Answers

0
votes

Example from the Roblox staff:

part.Touched:Connect(function(hit)
    local player = game:GetService("Players"):GetPlayerFromCharacter(hit.Parent)
    if player then
        -- do stuff
    end
end)