I’m trying to make a single script create multiple parts at my models position but I can’t make the part’s position go to all the models at the same time.
for i, v in pairs(animalFolder:GetDescendants()) do
wait(math.random(1,10))
local part = Instance.new("MeshPart", v)
local click = Instance.new("ClickDetector", part)
local clicksound= Instance.new("Sound")
clicksound.SoundId = soundid
part.BrickColor = BrickColor.new("Medium brown")
part.Size = Vector3.new(2,.5,.5)
click.MaxActivationDistance = 32
part.Position = v.body.Position --[[When I do this I get the error message "body is not a valid member of MeshPart "Workspace.ANIMALS.gurt.body"". So I tried this: v.Position and got the error message "Position is not a valid member of Model "Workspace.ANIMALS.gurt"" ]]
click.MouseClick:Connect(function(player)
addNmbr:FireClient(player)
poopsound:Play()
poop:Destroy()
end)
end
I tried a single position and they spawned there, but is there any way I could get them to spawn at all of the models positions?