Why do my end do a error

Hello back,
I do not understand this error message, help please:

You’re missing 1 or more “ends” or you have too many "end"s. There might some sort of function you started that might’ve not been ended, or you added an end for something that doesn’t exist.

You probably have an extra end, how does your code look like?

Please show us your code, we will help you more easily.

1 Like

You just need to add an extra end.

1 Like

This is my code, I writen it auto without adding myself a end.

1 Like

You have an extra end, get rid of one, also you didn’t close the for loop correctly, I think you placed the elseif in a way that it took away the end that closes the loop

1 Like

Still red. My code now

OH. Can you say a code that should fix it?

Remove an end and put an end after the player:Kick() line. Your code is currently

if ... then
   for i,v in pairs (...) do
     v:kick()
elseif ... then
    end
end 

It should be

if ... then
   for i,v in pairs (...) do
      v:kick()
   end
elseif ... then
    
end 

I know its’s not completely like that, but I’m not gonna rewrite the code from an image

1 Like

Still a error. Can I like quit? Seriously… The code.
Is it from roblox studio?

Remove the end inside of the elseif

image

This end to be specific

1 Like

Done, still red and my elseif is red now.

Show me again your code as of now

OH. Got fixed, well the legend say true. Even if there is no legends.

There ya go, I really recommend you look through your scripts carefully so you don’t have to make frequent devforum visits that could’ve been remedied by careful observation of code. If you have anymore issues don’t be afraid to make another post

1 Like

I would never have guessed anyways.

Again it’s all good, it’s part of the learning process, you just need to look carefully, you could’ve even hovered over the end to see what error it’s giving you

I am a beginner, I learned .Chatted today.

I know that you’re a beginner, but that doesn’t excuse careful code observation since that is crucial to debugging