Simple while loop doesn't work

I have a while loop that is supposed to play a frame-by-frame animation, but the loop doesn’t work for some reason. Can you help me?

local ContentProvider = game:GetService("ContentProvider")
ContentProvider:PreloadAsync(workspace.GIF:GetChildren())
local count = script.Frame
local timeout = script.Delay
while true do
workspace.Screen.Decal.Texture = workspace.GIF:FindFirstChild("frame_"..count.Value).Texture
if count.Value == 31 then count.Value = 0 end
wait(timeout.Value)
end

What is timeout? Is it an IntValue? Attribute?

delay is a stored NumberValue, and timeout is a stored IntValue.

Is this a local script or server script?

I think it’s because count is never incremented?

1 Like

A serverscript in ServerScriptService.

Oh. I see. Thank you! Don’t know how I missed that part…