I made a function in sword script and its working but with one issue hitting mutiple time.
I tried to put diffrent debounces at the same time and changed many thing but still hits multiple time
local db1 = false
function slash(dmg, cd)
local hum = hit.Parent:FindFirstChild("NPCHumanoid")
if hum and not db1 then
db1 = true
db1 = false
When you use
function slash(), it creates a new
blade.Touched function every single time, meaning multiple functions are firing off a single touch, making the debounce useless.
You can either disconnect the function at the end of the script or use
blade.Touched:Once() which immediately disconnects the function from the event after it fires.
Oh Thank you. İts works fine now.
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.