Hello, so my current script replicates itself to the playergui as long as it isn’t already in the playergui, and there isn’t already another duplicate of itself in there. However, when I check for the duplicated using findfirstchild, it always returns as nil.
if Gui.Parent ~= plr.PlayerGui then
if plr.PlayerGui:FindFirstChild("CaptainChat") == nil then
Gui.Parent = plr.PlayerGui
else
Gui:Destroy()
end
end
Oh alright. Local scripts in StarterGui are already cloned into the player’s PlayerGui, so why reinvent the wheel? I feel I am missing something here. What is it for?
It’s an NPC that speaks to the players. Putting in StarterGui wouldn’t be right, as the NPC doesn’t always speak with them. Currently the GUI is a child of StarterCharacter.
Nevermind, in the first statement I meant to check if the gui was a parent of plr gui, but I was checking it as script.Parent which would always fire as nil because the script never is a parent of anything but the Gui. Not sure how affected the second statement at all but, It seems to be working fine now, will update if anything goes wrong.