Sure, although you must give credit. But it is preferred if you have all code 100% done by you, but it is OK if you use some code from someone else, just credit them.
Of course. What i just mean if i was allowed to use some old code i made. But yea of course i will do the code myself i just ment like textures from the internet that was royalty free