Attempting to re-add old roblox textures

In short, im attempting to replicate the old roblox textures. I’m using a script to load these textures, and it works fine.

The problem is that I have no idea how to do things such as stopping visual fracturing between parts, making parts not be extremely shiny or textures being stuck to a single colour (ex: Grass is always Green, so setting it to white wont make it white, only a very white green). Yet, it seems people like Clonetrooper or the people behind RetroRoblox managed to do it.

I would like help with trying to make these textures work by directly importing them from old roblox clients and making it work as intended. If anyone has experience doing this, I would gladly appreciate your help.

Script in question, put it in a localscript inside ReplicatedFirst.

-- EXAMPLE TABLE --

-- 	local MaterialTable = {
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Front},
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Back},
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Top},
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Bottom},
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Left},
-- 		{TextureID, Transparency, U, V, Enum.NormalId.Right}
-- 	}

----------------------------------------------------------------------------------------

local RunService = game:GetService("RunService")
local ReplicatedFirst = game:GetService("ReplicatedFirst")
local RSConnection

local Wood = {
	{423024959, 0, 5, 30, Enum.NormalId.Front},
	{423024959, 0, 5, 30, Enum.NormalId.Back},
	{155806200, 0, 9, 9, Enum.NormalId.Top},
	{155806200, 0, 9, 9, Enum.NormalId.Bottom},
	{423024131, 0, 12, 9, Enum.NormalId.Left},
	{423024131, 0, 12, 9, Enum.NormalId.Right}
}

local CorrodedMetal = {
	{348399109, 0, 12, 12, Enum.NormalId.Front},
	{348399109, 0, 12, 12, Enum.NormalId.Back},
	{348399109, 0, 12, 12, Enum.NormalId.Top},
	{348399109, 0, 12, 12, Enum.NormalId.Bottom},
	{348399109, 0, 12, 12, Enum.NormalId.Left},
	{348399109, 0, 12, 12, Enum.NormalId.Right}
}

local DiamondPlate = {
	{412227439, .5, 1, 1, Enum.NormalId.Front},
	{412227439, .5, 1, 1, Enum.NormalId.Back},
	{412227439, .5, 1, 1, Enum.NormalId.Top},
	{412227439, .5, 1, 1, Enum.NormalId.Bottom},
	{412227439, .5, 1, 1, Enum.NormalId.Left},
	{412227439, .5, 1, 1, Enum.NormalId.Right}
}

local Grass = {
	{348400583, .5, 6, 6, Enum.NormalId.Front},
	{348400583, .5, 6, 6, Enum.NormalId.Back},
	{348400583, .5, 6, 6, Enum.NormalId.Top},
	{348400583, .5, 6, 6, Enum.NormalId.Bottom},
	{348400583, .5, 6, 6, Enum.NormalId.Left},
	{348400583, .5, 6, 6, Enum.NormalId.Right},
	
	--------------------------------------------
	
	{348400583, .5, 6, 6, Enum.NormalId.Front},
	{348400583, .5, 6, 6, Enum.NormalId.Back},
	{348400583, .5, 6, 6, Enum.NormalId.Top},
	{348400583, .5, 6, 6, Enum.NormalId.Bottom},
	{348400583, .5, 6, 6, Enum.NormalId.Left},
	{348400583, .5, 6, 6, Enum.NormalId.Right}
}

local Ice = {
	{348398440, .5, 12, 12, Enum.NormalId.Front},
	{348398440, .5, 12, 12, Enum.NormalId.Back},
	{348398440, .5, 12, 12, Enum.NormalId.Top},
	{348398440, .5, 12, 12, Enum.NormalId.Bottom},
	{348398440, .5, 12, 12, Enum.NormalId.Left},
	{348398440, .5, 12, 12, Enum.NormalId.Right},
	
	--------------------------------------------
	
	{348398440, .5, 24, 24, Enum.NormalId.Front},
	{348398440, .5, 24, 24, Enum.NormalId.Back},
	{348398440, .5, 24, 24, Enum.NormalId.Top},
	{348398440, .5, 24, 24, Enum.NormalId.Bottom},
	{348398440, .5, 24, 24, Enum.NormalId.Left},
	{348398440, .5, 24, 24, Enum.NormalId.Right}
}

local Slate = {
	{348401077, .5, 6, 6, Enum.NormalId.Front},
	{348401077, .5, 6, 6, Enum.NormalId.Back},
	{348401077, .5, 6, 6, Enum.NormalId.Top},
	{348401077, .5, 6, 6, Enum.NormalId.Bottom},
	{348401077, .5, 6, 6, Enum.NormalId.Left},
	{348401077, .5, 6, 6, Enum.NormalId.Right}
}

local Concrete = {
	{348398013, .5, 6, 6, Enum.NormalId.Front},
	{348398013, .5, 6, 6, Enum.NormalId.Back},
	{348398013, .5, 6, 6, Enum.NormalId.Top},
	{348398013, .5, 6, 6, Enum.NormalId.Bottom},
	{348398013, .5, 6, 6, Enum.NormalId.Left},
	{348398013, .5, 6, 6, Enum.NormalId.Right}
}

local function ChangeMaterial(Part, Material)
	if Material ~= nil then
		for i = 1, #Material do
			local Tx = Instance.new("Texture")
			Tx.Texture = "http://www.roblox.com/asset/?id="..tostring(Material[i][1])
			Tx.Transparency = Material[i][2]
			Tx.StudsPerTileU = Material[i][3]
			Tx.StudsPerTileV = Material[i][4]
			Tx.Face = Material[i][5]
			Tx.Parent = Part
		end
	end
	Part.Material = Enum.Material.SmoothPlastic
end

local function DeterminateTextureType(Part)	
	local materials = {
		[Enum.Material.Wood] = Wood,
		[Enum.Material.CorrodedMetal] = CorrodedMetal,
		[Enum.Material.DiamondPlate] = DiamondPlate,
		[Enum.Material.Grass] = Grass,
		[Enum.Material.Ice] = Ice,
		[Enum.Material.Slate] = Slate,
		[Enum.Material.Concrete] = Concrete
	}

	if materials[Part.Material] then
		local mat = materials[Part.Material]
		ChangeMaterial(Part, mat)
	elseif Part.Material ~= Enum.Material.Plastic and Part.Material ~= Enum.Material.SmoothPlastic then
		ChangeMaterial(Part, nil)
	end
end

local function OnJoin()
	for _, v in pairs(workspace:GetDescendants()) do
		if v:IsA("BasePart") and v ~= nil then
			DeterminateTextureType(v)
		end
	end
end

local function RunServiceFunction()
	if game:IsLoaded() then
		RSConnection:Disconnect()
		RSConnection = nil
		OnJoin()
	end
end

RSConnection = RunService.RenderStepped:Connect(RunServiceFunction)

This might not be script thing and more of a GFX / texture thing, but I dont know, sorry in advance if it doesnt belong here.

4 Likes