I removed the backpack with
game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, false)
Because of this, I'm unable to select weapons so I decided to make my own script for this purpose, it's able to print the gun and the player when I click 1 but it gives me an error "Unable to cast value to object"
Player = game.Players.LocalPlayer
Mouse = Player:GetMouse()
local plr = script.Parent.Parent
local plrname = plr.Name
Mouse.KeyDown:connect(function(key)
if key == "1" then
local gun = script.Parent.Menu.Frame.Spawn.ForceEQ.Value.Value
print(gun)
local player = game.Workspace:FindFirstChild(plrname)
print(player)
player.Humanoid:EquipTool(gun) -- ERROR IS HERE
end
end)

1 comment
Key down is deprecated use userinputservice and 'gun' is not an object its a value. You cant equip a value :)