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

Script Error "String Expected" Help?

I have no idea how I'll make my script work. It changes material. I would love a detailed explanation because I sometime have problems with Strings.

wait(1)
for i,v in pairs(script.Parent.Buttons:GetChildren()) do
	if v:FindFirstChild("ClickDetector") then
		v.ClickDetector.MouseClick:connect(function()
			script.Parent.Color.Material = v.Material
			script.Parent.Color2.Material = v.Material
			script.Parent.Parent.Parent.DropMaterial.Value = v.Material --Problem here
		end)
	end
end

DropMaterial is a StringValue

1 answer

Enums, like Material, are Integers, not Strings. Change DropMaterial to a IntValue.

2 comments

0

But the IntValue's Value is in numbers and I get and error that is : - Invalid value 0 for enum Material

0

I cahnged it and so on, Didn't work.

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