Basically what happens is it will give the player the tool, but nothing happens when I try to equip it. I'm guessing the tool simply falls through workspace because it's parented to GUI.
Is there anyway I can fix this by editing the Assign Class script to perhaps get the weapons from ReplicatedStorage instead of under PlayerGUI? If so, how would I do this? Or maybe is there an easier way to do this?
local 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(3454350)
script.Parent.Main.Visible = false --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 works in the Test mode, but when I run a test server or go in game, the same issue still persists. Not sure what is going on, and output isn't helpful either.