You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
The UnequipTools() function isnt working! -
What is the issue? Include screenshots / videos if possible!
Here is my script:
local player = game.Players.LocalPlayer
local EQUIPPED = false
local Debounce = true
script.Parent.MouseButton1Click:Connect(function()
if Debounce == true then
Debounce = false
if script.Parent.Name == "BirchWood" then
local Item = player.Backpack:FindFirstChild("BirchWood")
if Item then
local Char = player.Character
local Humanoid = Char:FindFirstChild("Humanoid")
if Humanoid then
if EQUIPPED == false then
EQUIPPED = true
Humanoid:UnequipTools()
wait(0.2)
Humanoid:EquipTool(Item)
elseif EQUIPPED == true then
EQUIPPED = false
wait(0.2)
Humanoid:UnequipTools()
end
end
end
end
wait(0.75)
Debounce = true
end
end)
This is placed in a local script, and what i need it to do is this:
When i press the button if the tool is unequipped then i want the tool to be equipped, and if it is equipped, i want it to unequip.
The equipping part works, although the tool doesnt unequip when i press the button again.
3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Yes, i looked through several posts, they dont have a solution that works
Thanks in advance!