Hi there! I need to know how to make roblox custom backpack. I already know how to hide default backpack. I know how to script gui but i dont know how to make player equips when clicks gui or press number button (1, 2, 3) Is anybody know how to do that?
✓ ANSWER ACCEPTED
How to force equip tool for player?
2 answers
✓ Accepted answer
The humanoid has an EquipTool function. You can read about it here.
You basically do Character.Humanoid:EquipTool(Backpack.Sword).
1 comment
0
Thanks :D
wait(0.001)
EnableBackpackGui = false --Change it to true if you want to keep backpack icon
Weapon = script.Parent.Name --Place it in a tool
local player = game:GetService("Players").LocalPlayer --Use a local script
local mouse = player:GetMouse(); --Get mosue
local char = player.Character --Character
local tool = player.Backpack:FindFirstChild(""..Weapon.."") --Find tool
db=1
while wait() do
if char then
game.StarterGui:SetCoreGuiEnabled(2,EnableBackpackGui) --Check if Icon is enabled.
for i,v in ipairs(char:GetChildren()) do
if v.className ~= ""..Weapon.."" then
wait()
if db == 1 then
player.Character.Humanoid:EquipTool(tool) --Force equip tool
db=2
end
end
end
script.Parent.Unequipped:connect(function() --If unequipped
db=1 --Make equipped
end)
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
I see you have accepted an answer but, I made a tutorial a while back on youtube on how to do this. You can check me out on YT: Previized