- I’m trying to disable the other buttons if one of them is already equipped
- The code
local player = game.Players.LocalPlayer
local val = player.Charactersfolder.equipvalue
local parentstuff = player.PlayerGui.chargui.Inventory
for _,d in pairs(parentstuff:GetDescendants()) do
if d.Name=='chview' then
-----
if player.Charactersfolder.equipvalue.Value == 1 then
d.Equipbtn.Text = "Equip"
end
if player.Charactersfolder.equipvalue.Value == 2 then
d.Equipbtn.Text = "Unequip"
end
-----
d.Equipbtn.MouseButton1Click:Connect(function()
if player.Charactersfolder.equipvalue.Value == 1 then
d.Equipbtn.Text = "Unequip"
wait(0)
player.Charactersfolder.equipvalue.Value = 2
end
end)
d.Equipbtn.MouseButton1Click:Connect(function()
if player.Charactersfolder.equipvalue.Value == 2 then
d.Equipbtn.Text = "Equip"
wait(0)
player.Charactersfolder.equipvalue.Value = 1
end
end)
end
end
I can’t find a proper solution so I’m asking for help.