Part returning nil on clone

image
So this is the code and take note of the two print statements on line 42 and line 44.

image
Now the console prints the line 42 without a problem and show the pointer in the console, however on cloning GUI then returns nil, then any ideas?

Try setting the cloned GUI’s parent to something.

1 Like

Are you sure WeaponGUI is a member of replicated storage? Check for capitalization too.

Yep because before it is cloned I print the variable out and it works, the clone creates no errors but after that its nil

Hey, what is the Archivable property of the WeaponGUI set to? If it’s set to false you won’t be able to clone it.

1 Like

instead of doing

GUI = GUI:Clone()

try adding local and changing the variable name?

local GUI_CLONE = GUI:Clone()

and try printing GUI_CLONE instead?

Still nothing


image
Its true but for some reason when I click play it turns off

hm, in line 41, add

local GUI = ReplicatedStorage:WaitForChild("WeaponGui")

and remove line 40.

then after line 44, add a simple if then check like

if GUI_CLONE then
   print("yes")
end

Still Nothing


that’s really weird hmm…
the GUI Archivable is already true so I don’t know why the :Clone() isnt working

Can you try this? Right after the GUI is cloned, set the parent in the next line
and make a print

Nope


I’m out of ideas, are there any lines located in the script that could possibly be interfering with the thing?

here is where it gets weird

Not the false being printed, but I set archivable to true above?

Are there any scripts in your game that changes the archivable property?

Ok took it to a empty world and it works thanks for the help now I just got to to find what is causing that

Oh sweet, also it could possibly be a plugin you are using.
Either way even if that’s not the case, good luck.

I found it, Adonis anti leak was forcing all replicated storage to have archivable off.