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:
1 | script.Parent.Touched:Connect( function (hit) |
2 | if game.StarterGui.Eggs.Egg 1. Visible = = true then |
3 | game.StarterGui.Eggs.Egg 1. Visible = false |
4 | 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 <eof>; 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.
You forgot to close the if
with an end
1 | script.Parent.Touched:Connect( function (hit) |
2 | if game.StarterGui.Eggs.Egg 1. Visible = = true then |
3 | game.StarterGui.Eggs.Egg 1. Visible = false |
4 | end |
5 | end ) |
If this works, please mark this answer as accepted