Rendering my map

Hey I don’t really trust or understand RoRender so i’m using this script and it’s failling to work.

Error:
image
Script:
Plus I dont know startx, starty, sizex, sizey, and stuff.

View
-- To get a more controlled map, change these settings. --

StartX = -200					-- The Starting X Position of the map
StartY = -200					-- The Starting Y Position of the map
Scale = .5							-- The scale of the map, 1 is 1 point per stud.
SizeX = 400						-- The X size of the map.  Starting at -200x, you would need 400 size to make 0x centered.
SizeY = 400						-- The Y size of the map.
Depth = 900					-- The depth of the survey area.  900 captures everything under 900 studs.  Don't go over 999, or things lower won't show up.  This is good for building maps.
Pixel = 1							-- The size of each pixel.  This has no effect on the survey points, just the display.

-- Each time you change a setting, you have to exit the place and reopen it.




	
local Workspace = game.Workspace 
local function rayCast(Pos, Dir, Max, Ignore) 
	return Workspace:FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore) 
end 

ABORT=false
rendering=false

checkColor=function(pos)
	local Dir = Vector3.new(0,-1,0) 
	local Hit, Pos = rayCast(pos, Dir) 
	if Hit then
		return Hit.BrickColor.Color
	else
		return BrickColor.new("Really black").Color
	end
end

map = nil

draw = function(startx, starty, steps, sizex, sizey, depth, size)
	rendering=true
	if map then map:remove() end
	core = Instance.new("ScreenGui", game:GetService("CoreGui"))
	map = Instance.new("Frame",core) 
	map.Position=UDim2.new(0,5,0,5)
	

	lastColorX = Color3.new(0,0,0)
	lastObjectX = nil

	curx,cury=0,0
	for y = starty, starty+(sizey*steps), steps do
		for x = startx, startx+(sizex*steps), steps do
			col = checkColor(Vector3.new(x,depth,y))

			if col ~= lastColorX then
				b=Instance.new("TextLabel") 
				b.Text="" 
				b.Parent=map
				b.BackgroundColor3=col
				b.BorderSizePixel=0
				b.Position=UDim2.new(0,((curx-1)*size),0,((cury-1)*size))
				b.Size=UDim2.new(0,size,0,size)
				lastObjectX=b
			else
				lastObjectX.Size = lastObjectX.Size + UDim2.new(0,size,0,0)
			end

			lastColorX = col

			curx=curx+1
			--wait()
		end
		wait()
		curx=0
		lastColorX = Color3.new(.003,.003,.003)
		cury=cury+1
		if ABORT then return end
	end
	rendering=false
end

--draw(-133, -103, tehr, (133+28)*(1/tehr), (103+20)*(1/tehr))






Off = function()

end

loaded = false

self = PluginManager():CreatePlugin()
self.Deactivation:Connect(function()
	Off()
end)

toolbar = self:CreateToolbar("Map")


tehr = 1

local plug = toolbar:CreateButton("Map","Create an overhead map","map.png")
plug.Click:Connect(function()
	--draw(-133, -103, tehr, (133+28)*(1/tehr), (103+20)*(1/tehr), 100, 1)
	--draw(-200, -200, tehr, (400)*(1/tehr), (400)*(1/tehr), 299, 1)
	draw(StartX, StartY, Scale, (SizeX)*(1/tehr), (SizeY)*(1/tehr), Depth, Pixel)
	--startx, starty, steps, sizex, sizey, depth, size
end)

loaded = true
print("Manager Loaded")

this is a really old script, 2010 I think