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

What does <eof> expected near elseif mean?

I really want to make this script work but it keeps on saying on Line 5164 expected near else if can someone please help Link: https://pastebin.com/q1ptSngX

1 comment

0

Oh yeah don't say it needs to be a local script BECAUE I WANT PEOPLE TO SEE THE DAMN SCRIPT

1 answer

This error means that you're missing an end somewhere before the elseif, OR you have too many ends (which is probably the case).

I just looked at your script, and that is what happened. You added the "end" for the if statement that the elseif is referring to, before the if statement completed.

Example to reproduce the error:

for i=1,10 do
	if i>5 then
		print("Index is more than 5")
	end -- End is not needed, get rid of it.
	elseif i==6 then
		print("Index is 6")
	end
end

If you were programming in basically any other language except for lua before this, this is actually a pretty common mistake, since most languages refer the "elses" after the if has ended.

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