Hello! Today I was wondering how to turn a .Touched into an if statement. For example, when a function fires that a .Touched is in, the .Touched gets “activated”, so even when the the isn’t fired, the .Touched still fires.
Heres a script example:
local function mine(hit)
if debounce == false then
print(hit)
debounce = true
task.wait(1)
debounce = false
end
end
local function mineAnimation(input,_gameProcessed)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
if track.IsPlaying == false then
if character:FindFirstChild(pickaxeTool.Name) then
track.Priority = Enum.AnimationPriority.Action
track.Looped = false
track:Play()
damagePart.Touched:Connect(mine) --I have to turn this into an if statement
end
end
end
end
userInputService.InputBegan:Connect(mineAnimation)
Thanks for the help!