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

Expected identifier when parsing expression, got '=' ?

Asked by
mrldie 0
1 year ago

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

Log in to vote
0
Answered by 1 year ago

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)
0
now its saying its an infinite yeild on WaitForChild("Frame") , anything to fix that? mrldie 0 — 1y
0
Do you have any other GUI's named Frame? Ksuki_Kun 0 — 1y
Ad

Answer this question