Hi, so I'm trying to make an automatic ball spawner at a certain position when the bricked is clicked, and after the brick is clicked twice the script is disabled. The ball for some reason isn't spawning, but it is printing Hi to show that the clicking is working. Is there something wrong with the cloning? Please help, I tried almost everything.
head = game.Workspace.corner.PRESS_ME.Head
clicked = false
head.ClickDetector.MouseClick:connect(function()
print("HI")
if click == false then
click = true
while click == true do
local BC = game.Lighting.Basketball:Clone()
BC.Parent = game.Workspace.corner.Spawner
BC.Handle.Position = Vector3.new(-7.8, 14.2, 31.6)
wait(5)
end
end
end)
head.ClickDetector.MouseClick:connect(function()
if click == true then
click = false
end
end)
