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

This script that should take damage isn't working...What's wrong with it?

Asked by 6 years ago
Edited 6 years ago

This script isn't working and it meant's to take damage when the player hits it!

local damage = script.Parent.Configurations.Damage.Value

for i, v in pairs(script.Parent.Body:GetChildren()) do
    if v.Name == "Brick" then 
        v.Touched:connect(function) 
            if hit.Parent and hit.Parent:FindFirstChild("Humanoid") and script.Parent.Configurations.CanDamage.Value == true then 
                hit.Parent.Humanoid:TakeDamage(damage) 
            end
        end)
    end
end

Is it messed up or something? Thanks alot,Bye

0
One: Is it giving any errors? And two, can we have a picture of your explorer? Tomstah 401 — 6y
0
v.Touched:connect(function(hit)) Hakurem 30 — 6y

Answer this question