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 <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
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