local r = Workspace.Part function onTouch (part) r.Material = random () wait (5) end a.Touched:connect(onTouch)
I am trying to get it so when you touch the brick it, it switches to a random Material. Can someone please tell me what is wrong here?
Material values are strings. You can do this:
local r = Workspace.Part function onTouch (part) r.Material = "Metal" wait (5) end a.Touched:connect(onTouch)
but there is nothing you can do to make it random automatically. You can do it using tables and math.random, though.