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?
The humanoid has an EquipTool function. You can read about it here.
You basically do Character.Humanoid:EquipTool(Backpack.Sword)
.
01 | wait( 0.001 ) |
02 | EnableBackpackGui = false --Change it to true if you want to keep backpack icon |
03 | Weapon = script.Parent.Name --Place it in a tool |
04 | local player = game:GetService( "Players" ).LocalPlayer --Use a local script |
05 | local mouse = player:GetMouse(); --Get mosue |
06 | local char = player.Character --Character |
07 | local tool = player.Backpack:FindFirstChild( "" ..Weapon.. "" ) --Find tool |
08 | db = 1 |
09 | while wait() do |
10 | if char then |
11 | game.StarterGui:SetCoreGuiEnabled( 2 ,EnableBackpackGui) --Check if Icon is enabled. |
12 | for i,v in ipairs (char:GetChildren()) do |
13 | if v.className ~ = "" ..Weapon.. "" then |
14 | wait() |
15 | if db = = 1 then |