Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

how to make that game pass script work ?(it doesn't give errors)

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)

2 comments

0

I don't know for sure but I saw on twitter that a lot of people were saying a curl error glitch was back and people showed their outputs saying the same thing. But I wouldn't take my word for it... In the meantime try switching the game.Players and the game.Workspace sections to game:GetService("Players") and game:GetService("Workspace")

0

ok thanks ^^ but i think its not the only proplem there D"":

2 answers

✓ Accepted answer

###This is because game passes IDs are no longer asset IDs. They are their own IDs. You use 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)

2 comments

0

I don't believe that's the problem, I highly doubt it. His code is similar to the Robloxdev.com Wiki's code. So I doubt that's even the problem. I highly doubt it.

0

thanks incapaz <3 you are the saver as always :D

I wonder if it's due to your connection. I've had cURL errors before, due to my connection. But I'm not sure.

1 comment

0

the proplem wasn't realy with that error

This discussion is preserved as it was. New answers, comments, and votes are closed.