So Basically, I already know how I can equip a "Tool" using a key bind Here is my Code, For a FlashLight
local player = game.Players.LocalPlayer
local character = player.Character
game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
if inputObject.KeyCode == Enum.KeyCode.R then
print("R was pressed")
if player and player.Character then
local humanoid = player.Character:FindFirstChildOfClass("Humanoid")
if humanoid then
local tool = workspace:FindFirstChild("Flashlight")
if tool then
humanoid:EquipTool(tool)
end
end
end
end
end)
So This script makes you equip "Tool" when you click R but I don't know where to put the "Humanoid: UnequipTool(tool)" in this part
So Basically This is my general question: How do I make my script when I press "R" it equips the tool but when I press "R" again it unequips the tool
sorry I was confused about this
