GetMaterialName

Constructor:

GetMaterialName()

Description

Used to retrieve the name of the object material.

Return Value

Type Description
string Material name

Examples

Create a part and retrieve the material name via GetMaterialName.

local part = RWObject.Create("Part") -- create a part
local m = part:GetMaterialName() -- retrieve the part material name
part.Name = m -- name the part after the part material name
part.Parent = WorkSpace
print(m)