Discord
Login
Community
DARK THEME

main() is not a function and expression expected in line ...

So today my programm decided to nor work peopwerly anymore, basically it cant acces the functions i defined in source, its telling me constantly that my functions arent defined tho they clearly are, because they worked just fine for a few days. on top it tells me expression expected in source line ..., i really dont know if this might be connected and what expression it expects, heres the code i added, after which the programm broke down:

fightmenu=function()

  local x = touch.x

  local y = touch.y

  local dimensionenA = [37,136,3,-22]// left right top bottom

  local dimensionenF = [37,136,-67,-92// left right top bottom

  k=0

  for i=dimensionenA[0] to dimensionenA[1] 

     if x == i then

       for i=dimensionenA[2] to dimensionenA[3]

         if y == i then

           k=1 //Attack pressed

         end

       end

     end

  end

  for i=dimensionenF[0] to dimensionenF[1] 

     if x == i then

       for i=dimensionenF[2] to dimensionenF[3]

         if y == i then

           k=2 //run pressed

         end

       end

     end

  end

  return k  <----- THis is the line where some expression is expected and i have no clue

end

i would really appreciate any help or suggestions to get my programm running again, thanks!

Edit : the problems are infact connected, if i remove this code it runs just fine, so something in this code fucks up the whole source code i guess

There us a closing bracket missing... ?
local dimensionenF = [37,136,-67,-92// left right top bottom

thanks, i feel so stupid right now ;(

I do that all the time 😂 Missing closing brackets, too many or not enough 'end' statements, it's just part of the fun ☺️

Post a reply

Progress

Status

Preview
Cancel
Post
Validate your e-mail address to participate in the community