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

can you help me fix error:argument missing or nil in a gamepass script?

If you see more errors please fix them but if not dont go out of your way to do so

local gamepassid_ = 8172261


game.Players.PlayerAdded:Connect(function(player)
	if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, gamepassid) then
		if player.Backpack:FindFirstChild("GravityCoil") == nil and player.Character:FindFirstChild("GravityCoil") == nil then
			game.ServerStorage:FindFirstChild("GravityCoil"):Clone()
			b.Parent = player.Backpack 
		end
	end
end)

error is on:

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.userId, gamepassid) then

2 comments

0

I believe it's player.UserId not player.userId

0

I believe it's player.UserId not player.userId

1 answer

✓ Accepted answer

Try:

if game:GetService("MarketplaceService"):UserOwnsGamePassAsync(player.UserId, gamepassid_) then

1 comment

0

thank you!

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