I asked this question yesterday, but no one really replied except for kingdom who told me to put the ball in ReplicatedStorage instead of Lighting. I did this, but there was still no difference. It does the same thing. Sometimes the ball moves to the vector, and other times it doesn't. Also, no errors are in output. It'd be great if someone could explain why. All help is appreciated! Here's the script:
local part = script.Parent
local db = true
local model = game.ReplicatedStorage.Model:GetChildren()
function gum(hit)
if hit then
if hit.leaderstats.Money.Value >= 5 then
db = false
hit.leaderstats.Money.Value = hit.leaderstats.Money.Value - 5
game.Workspace.tune:Play()
wait(2)
local ball = model[math.random(1,#model)]
ball:Clone().Parent = game.Workspace
ball.Position = Vector3.new(31,12,-6)
ball.Anchored = false
else
print("You need more money!")
end
wait(1)
db = true
end
end
part.ClickDetector.MouseClick:connect(gum)
Video to what is happening: https://www.youtube.com/watch?v=3ed029Lbt2E&feature=youtu.be

2 comments
I think the reason that it sometimes work is that by the time that the ball is cloned, the script has already moved onto and executed the next line. Other times it may not be as fast, and it doesn't work.
Wow! I worked! Also, maybe you know why my debounce doesn't work? Even when I click once, I can still keep clicking, just like in the video. It'd be great if you could answer that.