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

im working on a lock tool script but when i do it it doesnt work very well?

Asked by 4 years ago

It lets you unequip it for a second and i'm trying to find a way to make it so you cant see the boxes that tell you what your holding. It would also be cool to make it so you can scroll through weapons.

game:GetService("Players").PlayerAdded:Connect(function(player)
 local function hookTool(tool)
  if not tool:IsA("Tool") then return end
  game:GetService("RunService").Heartbeat:wait()
  tool.Parent = player.Character
 end

 player:WaitForChild("Backpack").ChildAdded:connect(hookTool)

 player.ChildAdded:connect(function(child)
  if child:IsA("Backpack") then
   child.ChildAdded:connect(hookTool)
  end
 end)

 for i,v in pairs(player.Backpack:GetChildren()) do
  hookTool(v)
 end
end)

Thanks!

Answer this question