#My printer broke...

2 messages · Page 1 of 1 (latest)

west halo
#

The code i have so far: (2 parts)

#
function preprocessData(data,b,ind)
    local imageTable = string.split(data, ",")
    local processedData = {}
    for a, entry in ipairs(imageTable) do
        local firstPart = string.sub(entry, 1, 6)
        local secondPart = string.sub(entry, 7)
        
        
        if tonumber(secondPart) then
            table.insert(ind,{a,secondPart})
            for i = 1, tonumber(secondPart) do
                table.insert(processedData, "0")
            end
        else
            table.insert(processedData, entry)
        end
    end

    return table.concat(processedData, ",")
end


local data = game.HttpService:GetAsync("https://gist.githubusercontent.com/fartylocal/383538495c26cbc2ec986007a80d883a/raw/8352145c9f646959f1aa0707c0d2533712cbc753/gistfile1.txt")

local mode = 1
local colortoignore = "1f2022a"
local step = 20 -- print X rows at a time
local origin = game.Workspace.o.Position  -- Replace with the desired origin
local blockSize = 0.1 -- Adjust this value based on your block size
local imageTable = string.split(data, ",")
local width1 = imageTable[1]
local height1 = imageTable[2]
table.remove(imageTable,1)
table.remove(imageTable,1)
data = table.concat(imageTable,",")
local mri_scans = {}
local parts = {}
local data = preprocessData(data,width1,mri_scans)
local imageTable = string.split(data, ",")
local step_ = 0

--print(data)
local function createColoredPart(position, color,name)
    local part = Instance.new("Part")
    part.Size = Vector3.new(1,1,1) * blockSize
    part.Position = position
    part.Name = name
    part.Color = Color3.fromHex(color)
    part.Anchored = true
    part.Parent = game.Workspace 
    part.Material = Enum.Material.SmoothPlastic
    return part
end