So I edited this Assign Class script to fit my game and weapons. It is a Local Script, and works fine in ROBLOX Studio solo, but whenever I go to test in on a server or in game, it doesn't work.
Basically what happens is it will give the player the tool, but nothing happens when I try to equip it. The gun scripts I have are pretty "fancy" as well, and are supposed to put the gun on the player's back if it is unequipped (and have a special equipped animation). However, as I mentioned, nothing happens, and whenever I equip the gun (which is not even there), my player's arms don't even move.
Here is the script:
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
Output doesn't say anything either.

2 comments
Nah bud. The problem is that roblox LocalScripts load before the character does. So, you gotta tell the script to wait for the character to load. Try this by putting it on line one with everything else below it: repeat wait() until game.Players.LocalPlayer.Character repeat wait() until game.Players.LocalPlayer.Character:IsDescendantOf(game.Workspace) wait(1 / 20)
That is a long time to wait lol. Like near a month