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

Expected identifier when parsing expression, got '=' ?

I'm a beginner, so I literally do not understand what's wrong. I've dealt with this error before but this one confused me. I'm simply just trying to make an invisible frame visible when touching a text button. script.Parent.MouseButton1Click:Connect(function() local Frame = script.Parent.Parent:WaitForChild("Frame").visible = true end)

1 answer

You cannot initialize this as a variable while also setting the frame's Visible property to true in the same line.

local Frame = script.Parent.Parent:WaitForChild("Frame").visible = true

You'll have to separate it into two lines like so:

script.Parent.MouseButton1Click:Connect(function()
	local Frame = script.Parent.Parent:WaitForChild("Frame")
	Frame.Visible = true
end)

2 comments

0

now its saying its an infinite yeild on WaitForChild("Frame") , anything to fix that?

0

Do you have any other GUI's named Frame?

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