What im trying to do is have multiple mines explode when you touch them.
function Touch(part)
while true do
touch = 1
wait(1)
end
end
function Mine(part)
if part.BrickColor == BrickColor.Black()then
explosion = Instance.new("Explosion")
explosion.Position = part.Position
explosion.Parent = game.Workspace
part.BrickColor = BrickColor.White()
else
if touch == 1 then
part.BrickColor = BrickColor.Black()
end
end
end
children = game.Workspace:GetChildren()
while true do
for _, child in pairs(children) do
if child.Name == "Mine" then
Mine(child)
end
end
wait(1)
end
Mine = game.Workspace.Mine
Mine.Touched:connect(Touch)

4 comments
Any errors? Is "Mine" an Model or what?
Also do note that your Mine function is override by the "Mine" variable and I don't see your Mine function called when the part is touched.
Mine is a part i have
The code works, but it will instantly explode upon playing because it's not looking to make sure that a person is touching it.