So whenever the game starts this script should be checking if someone has a VIP game pass; but insteed I get an error from the output that says: UserOwnsGamepassAsync is not a valid member of Player. Please help.
local VIP = require(script.Parent);
local WConfig = require(game.ServerScriptService.Windstone.Config);
local market = game:GetService("MarketplaceService");
local ID = VIP.infromation.vipID;
local clone
game.Players.PlayerAdded:Connect(function(player)
if player:UserOwnsGamepassAsync(player,ID) then
clone=VIP.infromation.vipLeaderstats.ui.vip:Clone();
if player and player.Character and player.Character.Head then
clone.Parent = player.Character.Head
end
end
for var1,var2 in pairs(WConfig.Admins,WConfig.EliteAdmins) do
if player.Name == var1 or var2 then
clone=VIP.infromation.vipLeaderstats.ui.admin:Clone();
if player and player.Character and player.Character.Head then
clone.Parent = player.Character.Head
end
end
end
end)
Output:
14:25:10.675 - UserOwnsGamepassAsync is not a valid member of Player

8 comments
player.UserId in line 8 not player
Does not help.
You may be saying the same thing below
What do you mean?
14:25:10.675 - UserOwnsGamepassAsync is not a valid member of Player
market:UserOwnsGamepassAsync not player
Thanks
You're welcome