I have a script in a folder, inside of that folder there are blocks. If you click a block an animation plays for that block, but the animation doesn’t work for some blocks.
Script: (I have deleted a portion of the script and left the animation part with its variables)
for i, LuckyBlock in ipairs(script.Parent:GetChildren()) do
if LuckyBlock:IsA("Model") then
local ClickDetector = LuckyBlock.ClickDetector
local debounce = false
ClickDetector.MouseClick:Connect(function(Player)
if debounce == false then
debounce = true
local Animation = script:WaitForChild("OpenAnimation")
local AnimationController = LuckyBlock:WaitForChild("AnimationController")
local Open = AnimationController:WaitForChild("Animator"):LoadAnimation(Animation)
wait(0.25)
Open:Play()
end
end)
end
end
Is there any difference between the blocks it does work on, and the blocks it doesn’t work on?
Do you get any errors when it doesn’t work? If yes, what errors?
They are exact copies (only different names), and when I join a new server and open a block it still won’t open but it does play the animation on some other blocks. So it works on some blocks but not on every block.