Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to force equip tool for player?

Asked by 8 years ago

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?

0
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 FiredDusk 1466 — 8y

2 answers

Log in to vote
1
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
8 years ago

The humanoid has an EquipTool function. You can read about it here.

You basically do Character.Humanoid:EquipTool(Backpack.Sword).

0
Thanks :D Dinakzy 6 — 8y
Ad
Log in to vote
0
Answered by 5 years ago
01wait(0.001)
02EnableBackpackGui = false  --Change it to true if you want to keep backpack icon
03Weapon = script.Parent.Name --Place it in a tool
04local player = game:GetService("Players").LocalPlayer --Use a local script
05local mouse = player:GetMouse(); --Get mosue
06local char = player.Character --Character
07local tool = player.Backpack:FindFirstChild(""..Weapon.."") --Find tool
08db=1
09while wait() do
10if char then
11game.StarterGui:SetCoreGuiEnabled(2,EnableBackpackGui) --Check if Icon is enabled.
12for i,v in ipairs(char:GetChildren()) do
13if v.className ~= ""..Weapon.."" then
14wait()
15if db == 1 then
View all 25 lines...

Answer this question