Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a texture changing part?

Asked by 6 years ago

How would I go about scripting a button that changes a parts texture when clicked?

1 answer

Log in to vote
0
Answered by 6 years ago

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)
0
Thanks! felonymartinez 12 — 6y
Ad

Answer this question