Scripting Problem :P

Can someone please help me I’ve spent so much trying to find out why the bit of code is not working. Everything I try does not seem to work!

And I then get a Null Reference.

NullReferenceException: Object reference not set to an instance of an object

I just don’t understand!

Someone please help!

You can’t tell what’s wrong by looking at that code.
General problem is as stated that you reference a null object.
For example you initialize your variable:

GameObject play = ...;

and you except play variable to hold reference of an instance of GameObject class. If however something went wrong with that code and your variable never got assigned GameObject type object then your variable has value null and referencing it:

play.CallSomeMemberMethodOfGameObjectClass();

will produce null reference error.

To avoid that situation you can:

if (play)
   play.CallSomeMemberMethodOfGameObjectClass();

Error message tells on what line it accrued so that will give you at least some idea which variable is being null referenced.
When you know that all there is left is to figure out what’s wrong with the code that was suppose to assign a value you expected to find.

What are PlayerManagerPrefab and LocalPlayerPrefab? Are those variables or names of classes or prefabs perhaps?

They are variables but thanks to your help the problem is now fixed. Thank you