Problem with saving Material to Datastore and getting it

I want to make a map saving system that uses datastore and inherits to new servers, I made it but I got stuck when it came to Material saving, I tried to use string.sub() to get the part after “Enum.Material” but it still doesn’t work for some reason, please help me.

image

The part of the script I save the part’s material:

["Material"] = string.sub(tostring(v.Material),15);

The part of the script I load part’s material:

	if v.Material then 
		newpart.Material = Enum.Material[v.Material]
	end
1 Like

I think you should check out this post.

2 Likes

This answered my question, thank you.