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.
I suggest storing the tools in the ReplicatedStorage, meaning that you'll have to alter the script a bit. The problem is, that when the parts in tools are parented to PlayerGui, Physics are applied on them causing them to fall through the map (Cause they are CanCollide false) and then getting deleted.
Hope it helps, but might be wrong!