Make player Accesory texture ID to default

So I made a script where if you jump in water it fires RemoteEvent. But if your humanoid state is landed, it Fires remotevent2 which is supposed to put the players’ things to their default. But When the player goes in the water. It changes the hat TextureID To A blue image so It makes the hat blue. But how do I make it so if the player jumps out of the water that fires remote event2 then it makes the player’s hats TextureID default?

Store a string value beneath the player that contains the default TextureId of the player’s hat and take it out when you want him/her to be.

1 Like

Yeah I did something like that but how do I store multiple? if the player has 2 hairs its going to set the same texture for both. this is the code that makes the hair blue and saves the default ID:

		for i, v in pairs(Character:GetChildren()) do
			if v:IsA("Accessory") then
				if v:FindFirstChild("Handle") then
					if v.Handle:FindFirstChild("HairAttachment") then
						if v.Handle:FindFirstChild("Mesh") or v.Handle:FindFirstChild("Special Mesh") then
							Character.Handler.HairID.Value = v.Handle.Mesh.TextureId
							v.Handle.Mesh.TextureId = "rbxassetid://66123413"
						end
					end
				end
			end
		end
	end
)

Then this is the code that loads the default hair Id:

		for i, v in pairs(Character:GetChildren()) do
			if v:IsA("Accessory") then
				if v:FindFirstChild("Handle") then
					if v.Handle:FindFirstChild("HairAttachment") then
						if v.Handle:FindFirstChild("Mesh") or v.Handle:FindFirstChild("Special Mesh") then
							v.Handle.Mesh.TextureId = Character.Handler.HairID.Value
						end
					end
				end
			end
		end

How can I make it save multiple values?

Can’t you just create two values, or is that necessary to use only one?

If you can so, make the first string store the default as soon as the player joins and the other one is simple. Put in the texture id for it.

1 Like