I'm trying to make a script, which is in workspace, to clone an npc to the position of any parts name "Tele"followed by random number from 1 to 10. (Ex: Tele1, Tele10). What this script basically does is spawn enemy npcs or mobs. Just got back to Roblox and am a bit rusty. Still a beginner at scripting, but I would appreciate your help. Thanks
Mobs = game.ReplicatedStorage.Mobs
X = math.random(10)
while wait() do
c = math.random(1,5)
if c == 1 then
Mobs["A.I.M. Melee Soldier"]:clone().Parent = game.Workspace
Mobs["A.I.M. Melee Soldier"].Torso.CFrame = workspace["Tele" .. X].CFrame + Vector3.new(0, 10, 0)
end
end

2 comments
X is only made once, put the math.random inside the while loop or something
Link a variable to the clone, the line of code below it may be referring to the NPC/Enemy inside of the Mobs rather then the cloned.