MouseButtonClick doesn't work

Hello. I’m making a skill system. According to my idea, when you enter the game, a gui with skills appears. To equip a skill you need to click on it. I wanted to make the skill system standalone. I have a module that contains all the data about skills. In short, it allows you to create a new button and boolValue of a skill. The problem is that when you click on
button, she moves it to the player’s skills, but doesn’t want to go back.

I’m not very good at explaining but I’ll attach a photo.

local Skill = script.Parent

local ButtonSkill = Skill.TextButton

local Players: Players = game:GetService(“Players”)
local Player = Players.LocalPlayer

ButtonSkill.MouseButton1Click:Connect(function()
local Copy = script.Parent
print(“ssss”)
local Values = Player.PlayerGui.Skils.SkillsFrame.Values
for _, object in ipairs(Values:GetChildren()) do
if object:IsA(“BoolValue”) then
if object.Name == Skill.Name and object.Value == false then
object.Value = true
Copy.Parent = script.Parent.Parent.Parent.PlayerSkills
end
if object.Name == Skill.Name and object.Value == true then
object.Value = true
Copy.Parent = script.Parent.Parent.Parent.NotingSkills
end
end
end
end)

Place1.rbxl (54.2 KB)