I made this weapon class gui but i want to add to it that classes 2- 6 wont be able to be clicked unles they have the level needed..meaning that what ever there level is in leaderboard it will unlock.. like say class 2 needs level 4 to be able to be clicked in the frame they are all name class 1,class2, class 3 and so on
Here it is
player = script.Parent.Parent.Parent
backpack = player.Backpack
function chooseClass(class)
for i, v in pairs(backpack:GetChildren()) do v:remove() end
for i, v in pairs(class:GetChildren()) do
if v:IsA("Tool") then
v:clone().Parent = backpack
elseif v:IsA("HopperBin") then
v:clone().Parent = backpack
end
end
script.Parent.Main.Visible = false --no new class for a little bit
wait(600000)
script.Parent.Main.Visible = true --allow to pick a different class
end
for i, v in pairs(script.Parent.Main:GetChildren()) do
v.MouseButton1Up:connect(function () chooseClass(v) end)
end

1 comment
This script is very strange... I only don't understand what's happening in your generic loop on line 18, I don't think that would even work... All you'll need to do is check where the level is stored to view the value and if it's not = to it, do nothing