I am new at ROBLOX scripting and have made the following code/script to make an object spawn infinitely.
while true do
wait(2)
hello = Instance.new("Part")
hello.Position = Vector3.new(0,22,0)
hello.Anchored = false
hello.CanCollide = false
hello.BrickColor = BrickColor.new("Baby blue")
hello.Parent = game.Workspace
end
However, I want to make it so that when the person hits the object they take damage and eventually die. I have tried looking up touch events that make this happen but do not seem to work.

1 comment
Unfortunately, JeeseSong the additional script you have given me does not work as the block does not seem to take damage when it falls on the ground.