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

Why is the = sign underlined in red?

Asked by 4 years ago
Edited 4 years ago

Im trying to make a script that changes the image in a box, but when I do this it underlines the equals in red saying then expected recieved =

local id = script.Parent.Value
local imageholder = script.Parent.One

activation:GetPropertyChangedSignal("Value"):connect(function()
    if id.Value = 1 then -- error here
        imageholder.Image =
    end
end

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

I realized my answer recognized the wrong thing, and I have since then edited it.

Question

Why is the = sign underlined in red?

Answer

You have a syntax error. When you're comparing a value to another you use double equal signs.

if someValue == otherValue then

end

You need to set = 1 to == 1

0
It should be something along the lines of "imageholder.Image='rbxassetid://2851926732' " ForeverBrown 356 — 4y
0
i forgot to specify that its the if id.Value = 1 then Wiggles1305 49 — 4y
0
my bad, just realized, edited my answer EpicMetatableMoment 1444 — 4y
Ad

Answer this question