You can write your topic however you want, but you need to answer these questions:
What do you want to achieve? PartSpawn Spawn more 5-15 but not only 1
What is the issue? script
local Dino= script.PartTest1
local Part = script.Parent
local function spawnDino (PartMesh, spawnArea)
local newPart = PartMesh:Clone()
PartMesh.Parent = workspace
local spacing = 6
local randomPosition = spawnArea.Position + Vector3.new(math.random(-spawnArea.Size.X / 6, -spawnArea.Size.X / 6 ), 2, math.random(-spawnArea.Size.Z / 6, -spawnArea.Size.Z / 6 ))
PartMesh.Position = randomPosition
end
for _, spawnArea in workspace.SpawnPart:GetChildren() do
for i = 1, 20, 1 do
spawnDino(Dino, spawnArea)
end
end
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
yes me look but the theme was similar but not mine was the case
Sorry for waiting Its work but have new problem he spawn only in 1 place And they should spawn in other places and have new problem { PartTest1 is not a valid member of Script “ServerScriptService.Script”}
Your problem is that you create local newPart at the start of the spawnDino function, but later you refer to PartMesh, which moves original part.
Try using this:
local Dino= script.PartTest1
local Part = script.Parent
local function spawnDino (PartMesh, spawnArea)
local newPart = PartMesh:Clone()
newPart.Parent = workspace
local spacing = 6
local randomPosition = spawnArea.Position + Vector3.new(math.random(-spawnArea.Size.X / 6, -spawnArea.Size.X / 6 ), 2, math.random(-spawnArea.Size.Z / 6, -spawnArea.Size.Z / 6 ))
newPart.Position = randomPosition
end
for _, spawnArea in workspace.SpawnPart:GetChildren() do
for i = 1, 20, 1 do
spawnDino(Dino, spawnArea)
end
end
local Dino= script.PartTest1
local Part = script.Parent
local function spawnDino (PartMesh, spawnArea)
local newPart = PartMesh:Clone()
newPart.Parent = workspace
local spacing = 6
local randomPosition = spawnArea.Position + Vector3.new(math.random(-spawnArea.Size.X / 3, spawnArea.Size.X /3 ), 3, math.random(-spawnArea.Size.Z / 3, spawnArea.Size.Z / 3 ))
newPart.Position = randomPosition
end
for _, spawnArea in workspace.spawnArea:GetChildren() do
for i = 1, 10, 1 do
spawnDino(Dino, spawnArea)
end
end