- I am trying to make simple sword
2.My sword’s hitbox won’t close so sword doesnt working
- I replaced hitbox = false position also tried task.delay
sword.Activated:Connect(function(Hit)
if db then return end
if db == false then
db = true
if hax == 1 and db == true then
vur()
hitbox = true
Hitbox.Touched:Connect(function(re)
if hitbox == true then
local plr = re.Parent:FindFirstChild("Humanoid")
if plr then
plr:TakeDamage(dmg)
hitbox = false end
hitbox = false
hax = 2
wait(cd)
db = false
end
end)
end
if hax == 2 and db == true then
hitbox = true
vur2()
Hitbox.Touched:Connect(function(re)
if hitbox == true then
local plr = re.Parent:FindFirstChild("Humanoid")
if plr then
plr:TakeDamage(dmg2)
hitbox = false end
hitbox = false
hax = 1
wait(cd)
db = false
end
end)
end
end
end)