-- The part you want to spawn a new part inside of
local part = workspace["Part Name"]
-- Getting the area you are allowed to spawn the part inside of (the hitbox of 'part')
local x = part.Size.X/2
local y = part.Size.Y/2
local z = part.Size.Z/2
local function spawn()
local newPart = Instance.new("Part") -- Spawn in your part
newPart.Position = part.Position + Vector3.new(math.random(-x, x), math.random(-y, y), math.random(-z, z)) -- In here we are setting the position to the first parts position and then randomly placing it inside the part using the constants we defined above
newPart.Parent = workspace["Set parent here"]
end