if self:GetParent():GetName() == "oUF_Raid" then
Thanks Zariel. Actually this worked for the party frame doing if self:GetParent():GetName() == "oUF_Party" then but not the raid frame for some reason however I've managed to do what I intended by using if (not unit) for the raid and the above for the party so its working :) Thank you!
Heres a couple of pics its basiclly p3lim fantastic frames with added raid frame.
The top picture doesn't have range checking enabled just to help show what the raid and party frames look like and ofc I wouldn't intead to show party frame whilst in a raid but its just there for testing.