Hello, I was wondering If there is anyway to force the player to equip a gear in the Backpack and not unequip it. Anything would help, thanks.
✓ ANSWER ACCEPTED
How do I force equip a gear?
2 answers
✓ Accepted answer
This checks the character for any tools that are not supposed to be equipped and equips the tool with the name of ToolName
local Players = game:GetService("Players")
while true do
wait()
pcall(function()
local ToolName = ("Name here")
local Character = Players.LocalPlayer.Character
local Humanoid = Instance.new("Humanoid")
for i,v in pairs(Character:GetChildren()) do
local t = {}
if v:IsA("Tool") then
table.insert(t,v)
end
if #t >= 2 then
Humanoid:UnequipTools()
end
end
Humanoid:EquipTool(Player:FindFirstChildOfClass("Backpack")[ToolName])
end)
end
you can find more information here
local Players = game:GetService("Players")
local player = Players:FindFirstChildOfClass("Players")
if player and player.Character then
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local tool = game.ServerStorage:FindFirstChild("Tool")
if tool then
humanoid:EquipTool(tool)
end
end
end
This discussion is preserved as it was. New answers, comments, and votes are closed.

3 comments
It doesn't seem to be working for me. Is there anything I should make sure i'm doing?
Make it a LocalScript in StarterPlayer.StarterCharacterScripts?
I have Tried That, My tool is in StarterPack. Is that the right place?