The part appears where it was placed, but not in the spawnArea

  1. What do you want to achieve? so that the part spawns in the “spawn AREA” but not where I put the part in workspace

  2. What is the issue? code

local obj = Part:Clone()
another code
obj.Parent = game.Workspace.spawnArea

  1. What solutions have you tried so far? I didn’t find it at all, I know that this is a child’s mistake, but I can’t find it

You need to specify the position. Just by specifying the parent doesn’t actually do anything, you’ve only parented it, not actually set its position.
Simply declare its position by doing

obj.Position = game:GetService("Workspace").spawnArea.Position

Screenshot_4

spawnArea is a folder. You need to have a place where you want this cloned part to go.

like this?

obj.Position = game:GetService("Workspace").spawnArea.Part.Position

Yup. Just make sure that Part is anchored so that it can’t be moved or anything.

After that, I wrote everything, it does not appear at all, but there is no error

Where is game:GetService("Workspace").spawnArea.Part? Is it where you want it to be? Did you anchor both the cloned part and this part?

proof 1 (Workspace)

Screenshot_2

Right I want to specify that they appear in the spawn Area

Can you send me a screenshot of your workspace in game? Show the spawnArea folder, if you can.

What did you mean to show the process itself?

No, the Explorer window. My bad, I wasn’t clear enough.


sorry for waiting bad internet

You need to also set the parent to game:GetService("Workspace").spawnArea
otherwise, it’ll stay in SSS and won’t be replicated to workspace.

And how to do it? (I am just learning)

As you did before. This is the full code, if you wanted it.

local obj = Part:Clone()
obj.Parent = game:GetService("Workspace").spawnArea
obj.Position = game:GetService("Workspace").spawnArea.Part.Position

Wow its work but I forgot to mention that when they spawn in different random positions And I have no idea how to make them do it.

but i have idea

local spawnArea = game.Workspace.spawnArea
local obj = Part:Clone()
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 ))
obj.Parent = game:GetService("Workspace").spawnArea
obj.Position = game:GetService("Workspace").spawnArea.Part.Position
obj.Position = randomPosition 

yes that should work
you can get rid of

obj.Position = game:GetService("Workspace").spawnArea.Part.Position

since you are going to change it in the next line anyway.

I found a solution to the problem but I have a question How to create a string that if Parttest:clone() == 20 then
parttest:delet()