Heirarchy
Fish>Lighting
FishSpawnScript>Water(a part)>Workspace
Fish Spawn Script
What i want is it to spawn a new fish every second. Put what it does it takes the same fish and respawns it.No errors in output btw
model = game.Lighting.Fish children = model:GetChildren() cl = model:Clone() function SpawnFish() print("Summoning Fishies....") for i =1, #children do if children[i] ~= nil then local a = cl local d = script.Parent print("Teleporting Fish....") a.Parent = d wait(.1) a.CFrame = d.CFrame + Vector3.new(0,1,0) end end print("Fishies Summoned!!!") end while true do wait(1) SpawnFish() end
With clones, you have to set the parent. Otherwise, they'll never show up.
model = game.Lighting.Fish children = model:GetChildren() function SpawnFish() print("Summoning Fishies....") for i =1, #children do if children[i] ~= nil then local a = model:Clone() local d = script.Parent print("Teleporting Fish....") a.CFrame = d.CFrame a.Parent = game.Workspace -- Or, wherever you want to put them. end end print("Fishies Summoned!!!") end while wait(1) do SpawnFish() end