Can I get some help? I'm a new programmer and I'm making a game and everything went well until this:
function MakeABall()
wait(5)
local bally = Instance.new("Part")
bally.Shape = ("Ball")
bally.BottomSurface = ("Smooth")
bally.TopSurface = ("Smooth")
bally.BrickColor = BrickColor.new("Dark stone grey")
bally.Material = ("Slate")
bally.Parent = game.Workspace
bally.Position = Vector3.new(40,94,-218.5)
function onTouch(part)
local humanoid = part.Parent:FindFirstChild("Humanoid")
if (humanoid ~= nil) then
humanoid.Health = 0
end
bally.Touched:connect(onTouch)
end
end
while true do
MakeABall()
end
I need a ball to spawn every 5 seconds, then if the player touches the ball they will die, and while the ball is spawning in the correct space every 5 seconds like it should, the ball won't kill the player on touch. Some help please?

7 comments
Err, doesn't look that accurate...
It doesnt look accurate but it works. Trust me
Hungry why dont you check out my games and realize that im a far better scripter than you. Maybe you shouldnt judge a book by its cover :/
Woah shots fired
^ shots fired indeed xD
I've edited mine you know
I still feel like my chunk of code is less lines than all of yours and works great. You should use mine :)