Expected 'then' when parsing if statement, got 'end'

Hello guys i was developing my game and i occurred one error that i couldnt figure it out to how to fix it then i came here to ask for help there are the errors


A basic ‘if statement’ needs to look like this -

if <condition> then
--code
end

the issue is that you’re not completing your if game.Workspace.. statement, but instead immediately calling your function

Try the following:

if game.Workspace["Working Sink"]["Sink System"].On then
	local getOn = game.Workspace["Working Sink"]["Sink System"].On
	getOn.ClickDetector.MouseClick:Connect(function()
		--do stuff
	end)
end

Remove the end) and tab the code in and put the end without the “)” add a “)” too it

What exactly are you checking for though?

So what i need to type i dont understand
[Instead of it]

I edited & added a possible replacement for your current issue, try it out

It kinda worked but like camera system have messed up but that is not in the output so idk what to do but thanks anyway

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.