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 **
local part = game.Workspace.Part local tool = script.Parent tool.Equipped:Connect(function() wait(1) b = 1 print("ready") end) local function lol() print("HI") end delay(.5, lol) if b == 1 then print("gone") script.Parent:Destroy() end end part.TouchEnded:Connect(lol)