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)
Problem MouseButton1Click is not defined by a tool, this is defined by a mouse object which can be created when selected.
Solution
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.Selected:connect(function(mouse) mouse.Button1Click:connect(Click) end)