Button Not Showing After Character Reset

Hi,
Can someone help me with this problem I have? I am trying to get a Gui Button get Cloned after the player resets his character, but is not cloning it. Its ignoring that line of code. I don’t have ResetOnRespawn activated. The Button is not cloning into the Parented location or elsewhere. I tried to print some text after that cloned code line and its printing. Do you have any solutions for this?

Players.PlayerAdded:Connect(function(player)
	
	player.CharacterAdded:Connect(function()
		
		local debo = false
		
		if debo == false then

			debo = true
			
			if not player:WaitForChild("PlayerGui"):FindFirstChild("AddGui") then
				
				if #player:FindFirstChild("Inventory"):GetChildren() == 0 then
				
					local cloneButton = game:FindFirstChild("ReplicatedStorage"):FindFirstChild("AddGui"):Clone()

					cloneButton.Parent = player:FindFirstChild("PlayerGui")
					
					print(cloneButton)
					
				end
				
			elseif player:WaitForChild("PlayerGui"):FindFirstChild("AddGui") then
				
				print("Already Cloned")
				
			end
			
		end
		
	end)
		
end)
1 Like

Activate ResetonRespawn and try again. I am guessing the local script is not activating the code due to that cause plus the button should already exists. If you don’t want to activate it, there could be another way around maybe by setting debounce to false at the end of your need.