How would I go about scripting a button that changes a parts texture when clicked?
✓ ANSWER ACCEPTED
How to make a texture changing part?
1 answer
✓ Accepted answer
Parts don't have textures, but Meshes do. I'll assume that you're using a Mesh:
mesh = script.Parent.Parent.Parent.Parent.Workspace.Part.Mesh
guibutton = script.Parent
guibutton.MouseButton1Down:Connect(function()
local list = {"000000000","000000000","000000000"} -- ID list
for i = math.random(1, #list) do
mesh.TextureID = "rbxassetid://"..list
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks!