passId = 6632153 --gravity passId2 = 6632270 --speed market = game:GetService("MarketplaceService") game.Players.PlayerAdded:Connect(function(player) function hasGravityPass(player) return market:UserOwnsGamePassAsync(player,passId) end function hasSpeedPass(player) return market:UserOwnsGamePassAsync(player,passId2) end player.CharacterAdded:Connect(function(char) if hasGravityPass() == true then grav = game.ServerStorage.GravityCoil:Clone() grav.Parent = player.Backpack end if hasSpeedPass() == true then speed = game.ServerStorage["Acceleration Coil"]:Clone() speed.Parent = player.Backpack end end) end)
It is returning with an error of "Argument 1 missing or nil"
passId = 6632153 --gravity passId2 = 6632270 --speed market = game:GetService("MarketplaceService") game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function() if market:UserOwnsGamePassAsync(player.UserId,passId) then game.ServerStorage.GravityCoil:Clone().Parent = player:WaitForChild("Backpack") end if market:UserOwnsGamePassAsync(player.UserId,passId2) then game.ServerStorage["Acceleration Coil"]:Clone().Parent = player:WaitForChild("Backpack") end end) end)
this will give them the item when the character has loaded if they have the gamepass