Ok I put this script inside of a frame that has TextButtons for children, but I also have a LocalScript inside of the frame directly below the script and I want the LocalScript to Activate after the player has chosen classes, what's wrong with this?
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
script.Parent.Title.Visible = false
end
function onHumanoidDied(humanoid, player)
script.Parent.Main.Visible = true
script.Parent.Title.Visible = true
end
for i, v in pairs(script.Parent.Main:GetChildren()) do
v.MouseButton1Up:connect(function () chooseClass(v) end)
end
game.StarterGui.Class.Main.LocalScript.Disabled = true
function LocalScript()
if LocalScript.Disabled == true then
game.StarterGui.Class.Main.TextButton.MouseButton1Clicked:wait()
game.StarterGui.Class.Main.LocalScript.Disabled = false
end
end
LocalScript.TextButton.MouseButton1Clicked:connect()

1 comment
Btw, Main is actually the Frame that's inside of the Screen GUI which is called class.