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
db = false
if hit.leaderstats.Money.Value >= 5 then
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
db = true
else
print("You need more money!")
end
end
end
part.ClickDetector.MouseClick:connect(gum)
Video to what is happening: https://www.youtube.com/watch?v=3ed029Lbt2E&feature=youtu.be

1 comment
Ok, I tried what you suggested but no difference. Here's a video to what's going on: https://www.youtube.com/watch?v=3ed029Lbt2E&feature=youtu.be