Ok, so I have 2 functions in this script. When you equip a tool it will wait 1 second and then change the value of a variable and the other functions wait till the value of the variable is changed and it runs. It works now, but It's not professional and very good in my opinion
Any other way of doing this?
Local script Inside tool
local part = game.Workspace.Part
local tool = script.Parent
tool.Equipped:Connect(function()
wait(1)
b = 1
print("ready")
end)
function lol()
if b == 1 then
print("gone")
script.Parent:Destroy()
end
end
part.TouchEnded:Connect(lol)
I just want 1 second delay for the "lol" function
**Please read what I said before answering **

1 comment
Added an extra end. Remove that end on line 18. This code that I gave to you was untested, so it might error out.