#Punch Tool Doesnt Work

9 messages · Page 1 of 1 (latest)

round iron
#

l have l problem with l script

#
    local character = player.Character
    local Humanoid = character:WaitForChild("Humanoid")
    local HumanoidRP = character:WaitForChild("HumanoidRootPart")
    local area = HumanoidRP.CFrame * CFrame.new(0,0,-3).Position
    local damage = 10
    
    local animation = {
        script.Parent.Animation[1],
        script.Parent.Animation[2]
    }
    
    local anim = Humanoid:LoadAnimation(animation[count])
    anim:Play()
    
    local region = Region3.new(area - Vector3.new(2,2,2),area + Vector3.new(2,2,2))
    local regiontable = workspace:FindPartsInRegion3(region,HumanoidRP,math.huge)
    
    for i,hit in pairs(regiontable) do
        if hit.Parent:FindFirstChild("Humanoid") and hit.Parent:FindFirstChild("db") == nil and hit.Parent.Name ~= player.Name then
            local db = Instance.new("BoolValue", hit.Parent)
            db.Name = "db"
            game.Debris:AddItem(db,.3)
            hit.Parent.Humanoid:TakeDamage(damage)
        end
    end
end)```
glacial tree
#

Idk

round iron
#

The enemys or npc dont want to take the damage

#

and l forgot for the local script

#
local maxcount = 2
local db = false
local cooldown = 1
local attackcooldown = .2
script.Parent.Activated:Connect(function(e)
    if e then return end
    if db == false then
        db = true
        
        count = count + 1
        script.RemoteEvent:FireServer(count)
    end
end)

spawn(function()
    while wait() do
        if db == true then
            if count == maxcount then
                wait(cooldown)
                count = 0
                db = false
            else
                wait(attackcooldown)
                db = false
            end
        end
    end
end)```
tidal fiberBOT
#

studio** You are now Level 2! **studio

round iron
#

ok sry guys the scirpt worked perfectly