Hey there, sorry to bother, but I'm looking for a way to force equip something in the player's backpack, I want to have a flashlight in the player's hand but I want them to not be able to de-equip it. Is there a way to do that?
Make sure your tool is in StarterPack.
Disable the Backpack from StarterGui
game.StarterGui:SetCoreGuiEnabled("Backpack", false)
When the player joins the game, take the tool from their backpack, and move it in the player's character
game.Players.PlayerAdded:connect(function(player) player.CharacterAdded:connect(function(character) player.Backpack:WaitForChild('TOOLNAME').Parent = character end) end)
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