If I have a packet cake which says to put 1/2 a cup of vegetable oil can I substitute that with butter?

I know fat's fat but I would rather the taste of a cake with butter not oil

I'm not a cook so I really don't know

Thanks