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

Error "Expected identifier when parsing expression, got ')' ", why?

Hello. I am creating a game and while doing some scripts i had this error: Expected identifier when parsing expression, got ')'. I don't know why it happend and I would love some help from you guys. Thanks in advice.

CODE:

script.Parent.Touched:Connect(function(hit)
	if game.StarterGui.Eggs.Egg1.Visible == true then
	game.StarterGui.Eggs.Egg1.Visible = false
end)

END OF THE CODE, ERRORS:

(

(Error says it's last line, 'end)'.)

(After deleting ')' at 'end)' it says: "Expected 'end' (to close 'function' at line 1), got ; did you forget to close the 'then' at line 2? ")

Problem got solved, but I don't know how to mark correct answer as good answer.

1 answer

✓ Accepted answer

You forgot to close the if with an end

script.Parent.Touched:Connect(function(hit)
    if game.StarterGui.Eggs.Egg1.Visible == true then
    game.StarterGui.Eggs.Egg1.Visible = false     
    end
end)

If this works, please mark this answer as accepted

6 comments

0

@Leamir you helped me, but I don't know how to mark answer as accepted, this is my first scriptinghelpers questoin.

0

Right under the comments section, should have a "Accept Answer" button

0

@Leamir Still I can't find it...

0

https://prnt.sc/ttfx5a << screenshot of the button (on the answer coment section)

0

@Leamir Yeah I don't have it. Probably reputation required or something like that.

0

Screenshot of the website that I see https://prnt.sc/ttfzoq

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