was t-Rex a hunter or scavenger

It was either neither or both, depending on how you phrase it. Like almost all carnivores it would have hunted prey and taken what it could find of already dead animals. We actually have excellent direct evidence of both hunting and sacvenging from the fossil reocrd, so it's not an either-or case.