I was trying to do this, when someone touches it, it would decrease into zero and killing someone. Here's what I got
function onTouched(hit)
local Humanoid = hit.Parent:FindFirstChild("Humanoid")
if Humanoid then
for i = 1, 20 do
script.Parent.Size = Size.new - 1
if script.Parent.Size == 0 then
Humanoid.Health = -5
print("Execution was successful!")
end
end
end
end
script.Parent.Touched:connect(onTouched)
I need a good answer :c

2 comments
Do you want it to shrink in all directions? And it is impossible for a brick's size to be equal to 0.
I know, I also thought of that just right now. Yeah, I'd like it to decrease in all directions.