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

2 comments

0

One: Is it giving any errors? And two, can we have a picture of your explorer?

0

v.Touched:connect(function(hit))