local gamePassID = 16268626
local userId = game.CreatorId
if game.CreatorType == "User" then
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(game.CreatorId,gamePassID) then
print("They DO have it")
else
print("THEY DONT have it")
script.Parent:Destroy()
end
else
local group = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId,)
local owner = group.owner
local ownerID = owner.Id
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(ownerID,gamePassID) then
print("They DO have it")
else
print("TRHEY DONT")
script.Parent:Destroy()
end
You have to give it the Enum for the CreatorType unless you specify you want to compare the name
You have an extra comma in GetGroupInfoAsync, and the owner key in the group info is Owner, not owner
There’s a missing end
I think this should be the version you should use
local gamePassID = 16268626
local userId = game.CreatorId
if game.CreatorType == Enum.CreatorType.User then
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(userid,gamePassID) then
print("They DO have it")
else
print("THEY DONT have it")
script.Parent:Destroy()
end
else
local group = game:GetService("GroupService"):GetGroupInfoAsync(game.CreatorId)
local owner = group.Owner
local ownerID = owner.Id
if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(ownerID,gamePassID) then
print("They DO have it")
else
print("TRHEY DONT")
script.Parent:Destroy()
end
end