Basically, in this script I'm creating, it detects the part's name, and then inserts a texture onto the part, according to the name. I'm wondering if what I've written so far is correct.
while true do function determineMaterial() if Part.Name == "MetalWall001" then local metal001 = Instance.new.Texture metal001.Texture = "http://www.roblox.com/asset/?id=190629879" metal001.Face = "Left" metal001.Face = "Right" metal001.Face = "Back" metal001.Face = "Front" local metal001a = instance.new.Texture metal001a.Texture = "http://www.roblox.com/asset/?id=190629867" metal001a.Face = "Top" end end end
You have many, many problems here.
There is no wait()
in the while loop; it will crash your game.
The function is never called, so it will never run.
Part
will cause an error; there is no Part
variable defined anywhere in the script.
The correct format for creating new instances is Instance.new("InstanceName", parent)
You never set the parent of the Texture created, so it will not exist in the actual game.
When setting Image or Texture properties, you must subtract 1 from the ID. You didn't.
Setting the Face of the object repeatedly is completely pointless. If you want it to appear on all faces, you must create multiple objects.
I would give you code, but it appears you still need to learn some of the basics of Lua. You can study on the wiki or with the video tutorials Roblox made.