Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Script Error "String Expected" Help?

Asked by 10 years ago

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

Log in to vote
0
Answered by
adark 5487 Badge of Merit Moderation Voter Community Moderator
10 years ago

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

0
But the IntValue's Value is in numbers and I get and error that is : - Invalid value 0 for enum Material alphawolvess 1784 — 10y
0
I cahnged it and so on, Didn't work. alphawolvess 1784 — 10y
Ad

Answer this question