server script (in the serverscriptservice) wich should print "hello" if a player who got the gamepass touches it... it doesn't give any error but when i wait for 2 minutes an error apeared in the output menu saying "Internal error while fetching asset type because MarketplaceService:getProductInfo() failed because HTTP 0 (CURL error (curl_easy_perform): Couldn't connect to server (7))"
brick = game.Workspace.brick service = game:GetService("MarketplaceService") brick.Touched:Connect(function(part) local character = part.Parent if character:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(character) if service:PlayerOwnsAsset(player,4826058) then print("hello") end end end)
UserOwnsGamePassAsync
instead.local brick = game.Workspace.brick -- use more local variables local service = game:GetService("MarketplaceService") brick.Touched:Connect(function(part) local character = part.Parent if character:FindFirstChild("Humanoid") then local player = game.Players:GetPlayerFromCharacter(character) if player and service:UserOwnsGamePassAsync(player.UserId,4826058) then print("hello") end end end)
I wonder if it's due to your connection. I've had cURL errors before, due to my connection. But I'm not sure.