Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

The spell that I'm making isn't doing damage, any help?

Asked by 2 years ago

I'm currently trying to make a spell do damage to an enemy in my game.

Here is my code:

local DmgAmnt = 15

Rock.Touched:Connect(function(Hit)
    local Debounce = false
        if Hit.Parent:FindFirstChild("Humanoid") then
            if Hit.Parent:FindFirstChild("Enemy") then -- this is a Boolean Val inside the entity
                if Debounce == false then
                    Debounce = true
                        print(Hit.Parent)
                        Hit.Parent.Humanoid:TakeDamage(DmgAmnt) 
                        wait(1)
                        Debounce = false
                        end
                    end
                end
            end)

Answer this question