Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by
hmurban 16
5 years ago

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)
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") yellp1 193 — 5y
0
ok thanks ^^ but i think its not the only proplem there D"": hmurban 16 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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)

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. User#21998 0 — 5y
0
thanks incapaz <3 you are the saver as always :D hmurban 16 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

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

0
the proplem wasn't realy with that error hmurban 16 — 5y

Answer this question