hello i have a script it is supposed to make anything under workspace.Objects wave but it is not working, if anyone could help, it would be awesome.

local Descendants = workspace.Objects:GetDescendants()
while true do
for _, object in ipairs(Descendants) do
if object.Name == "leaf" then
pos = object.Position
pos = Vector3.new(pos.x, pos.y-0.2, pos.z)
x = 0
z = 0
T = -99999
tall = object.Size.Y / 2
math.randomseed(tick())
rand = (math.random(0,20))/10
x = pos.x + (math.sin(T + (pos.x/5)) * math.sin(T/9))/3
z = pos.z + (math.sin(T + (pos.z/6)) * math.sin(T/12))/4
object.CFrame = CFrame.new(x, pos.y, z) * CFrame.Angles((z-pos.z)/tall, 0,(x-pos.x)/-tall)
T = T + 0.12
end
end
wait()
end

Is this a local script or script? If itâ€™s a local script where is it parented to? If itâ€™s a script, then add a print before your loop and check if that prints