Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

What does <eof> expected near elseif mean? [closed]

Asked by 5 years ago

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

0
Oh yeah don't say it needs to be a local script BECAUE I WANT PEOPLE TO SEE THE DAMN SCRIPT Killerlol603 -17 — 5y

Closed as Too Broad by User#24403

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 5 years ago

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.

Ad