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

[Solved] unequip humanoid tools on key press?

Asked by 6 years ago
Edited 6 years ago

Thanks to Soybeen on Roblox Forums for the help:

local uis = game:GetService("UserInputService")
local player = game.Players.LocalPlayer

function UnequipTools()
for _,v in next,player.Character:GetChildren() do
if v:IsA("Tool") then
v.Parent = player.Backpack
end
end
end

uis.InputBegan:connect(function(input,gp)
if gp then return end
local key = input.KeyCode
if key == Enum.KeyCode.Q then
UnequipTools()
end
end
end)

Answer this question