So I have a magic script, that has two meshes, that are determined by a GUI, when the GUI changes the Mesh.Value changes. I realized the reason the mesh being used wasn't changing was due to the script running only once, and never running again with the updated values. So now i get to the problem with Looping, since whenever i start a loop either it just spams :Clone, or the variable isn't declared.
--Selection of mesh1 and mesh2
local Mesh1 = Meshes:WaitForChild(FirstMesh.Value):Clone()
print(Mesh1)
Mesh1.CFrame = Humrp.CFrame * CFrame.new(0,0,-3)
Mesh1.Orientation = Mesh1.Orientation + Vector3.new(-90,0,0)
Mesh1.Parent = effectsfold
local Mesh2 = Meshes:WaitForChild(SecondMesh.Value):Clone()
print(Mesh2)
Mesh2.CFrame = Mesh1.CFrame
Mesh2.Orientation = Mesh2.Orientation + Vector3.new(-90,0,0)
Mesh2.Parent = effectsfold
My attempts at solving this:
while wait() do
local Mesh1 = Meshes:WaitForChild(FirstMesh.Value):Clone()
print(Mesh1)
Mesh1.CFrame = Humrp.CFrame * CFrame.new(0,0,-3)
Mesh1.Orientation = Mesh1.Orientation + Vector3.new(-90,0,0)
Mesh1.Parent = effectsfold
local Mesh2 = Meshes:WaitForChild(SecondMesh.Value):Clone()
print(Mesh2)
Mesh2.CFrame = Mesh1.CFrame
Mesh2.Orientation = Mesh2.Orientation + Vector3.new(-90,0,0)
Mesh2.Parent = effectsfold
end

4 comments
Just put the clones out of the loop.
I've tried that, and then it says Mesh isnt declared.
Where's the loop
i posted my loop attempt that i did before hand