Changing mesh textures

So I’m trying to create a GUI image button that changes multiple textures on meshes, not material such as grass or glass, textures as in textureIDS that go onto meshes. I’m currently making a anime game so I need these buttons to change the textures of the Starter characters so I can have different skin tones
sKINTONES
I’ve tried looking in toolbox, devforum and I’ve tried making my own but failed because I had no clue on what I was doing. I couldn’t find anything relevant to what I’m trying to do so I came to ask for help.

2 Likes
local players = game:GetService("Players")
local player = players.LocalPlayer
local character = player.Character or player.CharacterAdded:Wait() --Reference to the player's custom StarterCharacter model.
local mesh --Path to the CustomCharacter's mesh.

local button = script.Parent

local textureId = 0 --Change to ID of desired texture.

button.MouseButton1Click:Connect(function()
	mesh.Texture = "rbxassetid://"..textureId
end)

A bit of pseudo-code to hopefully navigate you in the right direction.

3 Likes

Thank you but the script seems to be local? I was looking for a serversided one but thank you.

Is the “change mesh texture” function works in Server?
If the function works in server, everyone could see the changes.
If the function works in Client, only the player who pressed the button could see the changes.

1 Like

Have localscript fire remote event with prescribed texture to change on mesh then the server will change texture

1 Like