Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a texture changing part?

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

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)

1 comment

0

Thanks!

This discussion is preserved as it was. New answers, comments, and votes are closed.