Like the title suggests, I'm trying to create a script where I'm using a table to create multiple parts that share the same name. This is the script I tried:
local EpicPart = Instance.new("Part")
Table1 = {EpicPart,EpicPart,EpicPart}
a = 30
for i,v in pairs (Table1) do
v.Parent = game.Workspace
v.Position = Vector3.new(0,0,a)
a = a + 5
v.Anchored = true
v.CanCollide = true
v.Touched:Connect(function(hit)
local humanoid = hit.Parent:FindFirstChild("Humanoid")
if humanoid then humanoid.Health = humanoid.Health - 100
end
end)
end
