I’m trying to make it so that it creates parts around the character on a radios of 3 away from the character on a x and z axes using CFrame, but when they all spawn in, they all spawn on the same spot… So can anyone help me tweak it so that they all spawn in different locations? Here’s the script that I’ve got so far…
local dirt = nil
dirt = Instance.new("Part")
dirt.formFactor = 2
dirt.Size = Vector3.new(1.678, 0.315, 1.663)
dirt.BrickColor = BrickColor.new("Dark taupe")
dirt.Material = 'Slate'
dirt.TopSurface = 0
dirt.BottomSurface = 0
dirt.Elasticity = .01
local limit = 13
for i=1,limit do
local b = dirt:Clone()
local v = Vector3.new(math.random() - -0.5, math.random() - -0.5, math.random() - -0.5).unit
b.CFrame = Char:FindFirstChild('HumanoidRootPart').CFrame * CFrame.new(math.random(3),0,math.random(3))
b.Parent = game.Workspace