GUI is not cloning into PlayerGui

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’ve made an developer panel, with some cool features. I want it to check if your one off the devs using UserId, and a module script.
  2. What is the issue? Include screenshots / videos if possible!

It works when they join, but if they die, it won’t work.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Changing the GUI location, but nothing fixes it.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

Screenshot 2023-01-31 191157

Here’s the script.



game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Module = require(script.Developers)
			if table.find(Module.UserIds, Player.UserId) then
			print("Is a Developer")
			print("respawning")


				local PlayerGui = Player:WaitForChild("PlayerGui")
				local Panel = script.DeveloperPanel:Clone()
				Panel.Parent = PlayerGui
			end
		end)
	
end)

Do the debugs print again when you respawn?

Yup, so it’s just the cloning that is not working.

Check your playergui to see if it’s being added. Maybe it’s just disabled or something? If not, it’s very odd that it isn’t being cloned.

1 Like

Tried doing that aswell, nothing popped up in the PlayerGui/StarterGui. I’m guessing it’s an bug on roblox’s part.

Can you print this after you parent the clone?

print(Panel:GetFullName())
task.wait()
print(Panel:GetFullName())

“Players.RealRaiarGaming100YT.PlayerGui.DeveloperPanel” - Server - DeveloperPanel:14
19:21:39.113
“DeveloperPanel” - Server - DeveloperPanel:16

That’s weird. First it was parented, but after it wasn’t.



game.Players.PlayerAdded:Connect(function(Player)
	Player.CharacterAdded:Connect(function(Character)
		local Module = require(script.Developers)
			if table.find(Module.UserIds, Player.UserId) then
			print("Is a Developer")
			print("respawning")
			

				local PlayerGui = Player:WaitForChild("PlayerGui")
				local Panel = script.DeveloperPanel:Clone()
			Panel.Parent = PlayerGui
			print(Panel:GetFullName())
			task.wait()
			print(Panel:GetFullName())
			end
		end)
	
end)

So it’s being destroyed or parented to nil after you parent it to the playergui, which is weird. For now I would try waiting 1-5 seconds before parenting the cloned gui, just for testing. If it works, then that could help you fix it.

Did a 2 second wait, it works! I guess it loaded in right before the player respawned for some reason.

Well wait, that was only a temporary solution. We should figure out why it is being destroyed so we can fix that. From what you said, it seems like corescripts are the ones destroying the gui.

This would be the case if ResetOnSpawn was true for that gui. To fix it, you should turn that off instead of waiting 2 seconds. With that solution, you also don’t need to clone the gui for everytime they respawn.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.