Change a Brush Texture

Hey guys

i found a old script that contains the SetMaterialTexture command wich don’t work.
Could someone tell me how to set a texture of a Brush in Lua?

Mine ( wich does not work = nil value ):



function EnableSnow ( )
	if (GAMEMODE.SnowOnGround) then return; end
	GAMEMODE.SnowOnGround = true;
	
	for k, v in pairs(REPLACING_TEXTURES) do
		if (v[1] && v[3]) then
			v[1]:SetMaterialTexture("$basetexture", v[3]);
			
			if (v[4]) then
				v[1]:SetMaterialTexture("$basetexture2", v[3]);
			end
		end
	end
end


Table:



local REPLACING_TEXTURES = {	
								"customtext/gc textures/blends/grass_dirt_blend04", 
								{"nature/blendgrassdirt001a"},
								"ajacks/ajacks_grass01",
								"de_train/train_cement_floor_01",
								"highrise/se1_cement_office_floor_01",
								"building_template/roof_template001a",
								"de_nuke/nukroofa",
								"wood/woodshingles002a",
								"cs_havana/swampground01a",
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-7835_-10036_144", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-8124_-10028_144", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-9310_-9239_200", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_3498_4227_126", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-6806_-7527_137", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-6702_-7698_137", // ->
								"maps/rp_evocity_v3x/cs_assault/pavement001a_-9368_-8601_200", // ->
								"de_nuke/nukroof01",
								"maps/rp_evocity_v3x/nature/blendgrassgravel001a_wvt_patch",
								"de_tides/tides_dirt",
								"concrete/concretefloor006a",
								"nature/blendgrassgravel001a",
								"de_train/train_cementwear_01",
								"ajacks/ajacks_road1", // ->
								"ajacks/ajacks_road2", // ->
								"ajacks/ajacks_road7", // ->
								"ajacks/ajacks_road6", // ->
								"ajacks/ajacks_road8", // ->
								"ajacks/ajacks_road5", // ->
								"ajacks/ajacks_road3", // ->
								"ajacks/ajacks_10", // ->
								"sgtsicktextures/sicknessroad_01", // ->
								"sgtsicktextures/sicknessroad_02", // ->
								"sgtsicktextures/gunroad_01", // ->
								"concrete/concretefloor024a", // ->
								{"nature/blendcliffgrass001a"},
								"maps/rp_evocity_v3x/metal/metalroof005a_-3404_11999_241",
								"concrete/prodroofa",
								"de_prodigy/metal01",
								"de_train/train_cement_floor_02",
								"labs/se1_cement_lab_floor_02",
								"de_tides/tides_grass_a",
								"props/rubberroof002a",
								"metal/metalwall026a",
								"metal/milroof002",
								"maps/rp_evocity_v3x/tile/tileroof004b_-2893_-6215_262",
								"maps/rp_evocity_v3x/tile/tileroof004b_3088_-7809_218",
								"concrete/concretefloor038a", // ->
								"nature/grassfloor002a",
								"maps/rp_evocity_v3x/bridge/se1_concrete_flat_01_3088_-7809_218", // ->
								"maps/rp_evocity_v3x/bridge/se1_concrete_flat_01_10142_14229_123", // ->
								"maps/rp_evocity_v3x/bridge/se1_concrete_flat_01_3498_4227_126", // ->
								"metal/milwall002",
								"maps/rp_evocity_v3x/tile/tileroof004b_-2877_-5493_262",
								"maps/rp_evocity_v3x/tile/tileroof004b_-2770_-7024_262",
								"wood/milroof001",
								"nature/gravelfloor003a", // ->
								"buildings/asph_shingles01",
								"wood/milroof005",
								"de_train/train_grass_floor_01",
								"props/tarpaperroof002a",
								"nature/blendpavedirt01",
								"de_cbble/grassfloor01",
								"maps/rp_evocity_v8x/nature/blendgrassdirt02_noprop_wvt_patch",
								"nature/blendgrassdirt02_noprop",
								"nature/blendgrassdirt02_noprop_wvt_patch",
								"maps/rp_evocity_v8x/cs_italy/cobble03_-6480_-8825_136",
								"de_tides/tides_floor_stone_1",
								"stone/infflrd_blend_dirt",
								
								// Trees
								"models/props/cs_militia/trees3b", // ->
								"models/props/cs_militia/trees1b", // ->
								"models/props/cs_militia/trees3", // ->
								"models/props/cs_militia/trees2", // ->
								"models/props_foliage/tree_deciduous_01a_leaves", // ->
								"models/props_foliage/tree_deciduous_01a_leaves2", // ->
								"models/props_foliage/tree_pine_01_branches", // ->
								"models/trees/g_branch01", // ->
								"models/trees/g_branch02", // ->
								"models/trees/g_branch03", // ->
								"models/trees/g_branch05", // ->
								"models/trees/japanese_tree_round_02", // ->
								"models/trees/japanese_tree_round_03", // ->
								"models/trees/japanese_tree_round_04", // ->
								"models/trees/japanese_tree_round_05", // ->
								"models/msc/e_bigbush", // ->
								"models/msc/e_bigbush3", // ->
								"models/msc/e_leaves", // ->
								"models/msc/e_leaves2", // ->
							};


This sounds like it belongs in the Developer Discussion section.