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

Why is the = sign underlined in red?

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

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

3 comments

0

It should be something along the lines of "imageholder.Image='rbxassetid://2851926732' "

0

i forgot to specify that its the if id.Value = 1 then

0

my bad, just realized, edited my answer

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