So, my Vip door is a gamepass, and I have done soooooo much but it wont work! I dont know whats going on, but im not getting any errors either. Please help me!
local Id = 5266510
script.Parent.Touched:Connect(function(hit)
--hit
if hit.Parent:FindFirstChild("Humanoid") then --makes sure the object touching the door is a player
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,Id) then
script.Parent.CanCollide = false
end
end
end)

7 comments
try printing this : game:GetService("MarketplaceService"):UserOwnsGamePassAsync(plr.UserId,Id)
also you never checked is plr existed
where do you think i should do the "if plr then"
If this were to work, once one player had the gamepass, everyone would be able to enter since cancollide is server wide.
Are you sure the gamepass ID is correct?
are you testing if it works in studio or in game? sometimes my gamepass scripts are buggy in studio but work in game.
@zor_os, it should make no difference whatsoever