I want to make a apple picking script and make them all brown when you pick them but for some reason when I have this part of the script
wait(5)
debounce = false
v.Size = Vector3.new(1,1,1)
v.BrickColor = BrickColor.new("Bright red")
this happens:
but when I remove it all of them are brown
here is the script
local apple_models = script.Parent.Parent.Parent.Apples
local apples = apple_models:GetDescendants()
debounce = false
script.Parent.TriggerEnded:Connect(function(player)
if debounce == false then
for i, v in pairs(apples) do
print("picking apples")
script.Parent.Enabled = false
debounce = true
v.BrickColor = BrickColor.new("Brown")
local appleSize = v.Size
v.Size = Vector3.new(0.75,0.75,0.75)
wait(5)
debounce = false
v.Size = Vector3.new(1,1,1)
v.BrickColor = BrickColor.new("Bright red")
end