Here is the script.
bin = script.Parent
move = script.Parent.Parent.Parent
function Click(Player)
if script.Parent.Parent.Parent.Parent.GunSelector.Value == "M4" then
game.Lighting.M4:Clone().Parent = game.Players.LocalPlayer.Backpack
local player = game.Players.LocalPlayer
local character = player.Character
local tool = player.Backpack.M4
local function equip(tool)
tool.Parent = character
end
tool.Equipped:connection(equip)
-- ^ This won't equip it...
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
move:Destroy()
print("Entered")
end
bin.MouseButton1Click:connect(Click)

3 comments
tool.Equipped:connect(equip) but btw there's more stuff wrong with your script I believe
I'll edit it so I can be able to put the entire code
@DarwinYork