I kinda need help with a error.

So I am fucking around with this system that replaces textures and i have ran into a error that i can’t seam to fix at all.

attempt to call method ‘GetMaterialTexture’ (a nil value)

for k, v in pairs(REPLACING_TEXTURES) do
local mat = Material(“Nature/snowfloor001a”)

	local useName = v
	local newTable = {};
	if (type(v) != "string") then
		useName = v[1]
		newTable[4] = mat:GetMaterialTexture("$basetexture2");

“mat:GetMaterialTexture” should just be “mat:GetTexture” and $basetexture2 isn’t a valid shader paramater.

ur a fucking god