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)