All pastes #137361 Raw Edit

Anonymous

public lua v1 · immutable
#137361 ·published 2006-08-18 10:10 UTC
rendered paste body
--As requested by Spoco here is the LCD Demo for GMod--Load GMX for our table loading and saving shiteif gmx==nil then _OpenScript("lib/gmx/init.lua") end --Declare our table of pixelsPixel = {}--Add sizesWIDTH = 15HEIGHT = 15function copyToWorld()	for x=1,HEIGHT do	Pixel[x] = {}		for y=1,WIDTH do			local colorString=Pixel[x].y.r .. " "..Pixel[x].y.g.." "..Pixel[x].y.b.." " .. Pixel[x].y.a			local entid = _EntGetByName("pixel"..x"x"..y)			_EntFire(entid,"color",colorString,0)		end	endendfunction initPixels()	for x=1,HEIGHT do	Pixel[x] = {}			for y=1,WIDTH do			Pixel[x].y = {}			Pixel[x].y.r = 1			Pixel[x].y.g = 1			Pixel[x].y.b = 1			Pixel[x].y.a = 255 		end	end	copyToWorld()endinitPixels()function savePattern(userid,name)	gmx.saveTable(Pixel,"lcdpatterns/"..name..".lcd")endfunction loadPattern(userid,name)	gmx.loadTable("lcdpatterns/"..name..".lcd")	copyToWorld()endCONCOMMAND("savelcd",savePattern)CONCOMMAND("loadlcd",loadPattern)