Jump to content




Error: index.lua :58: 'end' expected (to close 'if' at line 30)


  • You cannot reply to this topic
5 replies to this topic

#1 dragonxtamer596

  • New Members
  • 14 posts

Posted 21 October 2012 - 01:44 AM

code
red = Color.new(255,0,0)
black = Color.new(0,0,0)
white = Color.new(255,255,255)

menustatus = 1

while true do
screen:clear(black)
pad = Controls.read()
end

if pad:up() then
menustatus = menustatus - 1
screen.waitVblankStart(4)
end

if pad:down() then
menustatus = menustatus + 1
screen.waitVblankStart(4)
end

color={white, white, white}

screen:print(50, 50, "Play", color[1])
screen:print(50,60,"Options", color[2])
screen:print(50,70,"Exit", color[3])

color[menustatus]=red

if menustatus == 1 then
if pad:cross() then
dofile("Game.lua")

if menustatus == 2 then
if pad:cross() then
--insert options here
end
end

if menustatus == 3 then
if pad:cross() then
while true do
break
end
end

if menustatus <= 0 then
menustatus = 3
end

if menustatus >= 4 then
menustatus = 1
end

screen.flip()
screen.waitVblankStart()
end
end

#2 jag

  • Members
  • 533 posts
  • LocationStockholm, Sweden

Posted 21 October 2012 - 02:23 AM

Could you post a description of your problem? Or at least add some [code] tags

#3 NIN3

  • New Members
  • 57 posts
  • LocationEverywhere.

Posted 21 October 2012 - 02:27 AM

Best I can say is that this line
if menustatus == 1 then
if pad:cross() then
dofile("Game.lua")

Is missing 2 ends

#4 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

Posted 21 October 2012 - 03:00 AM

View PostNIN3, on 21 October 2012 - 02:27 AM, said:

Best I can say is that this line
if menustatus == 1 then
if pad:cross() then
dofile("Game.lua")

Is missing 2 ends

Those are actually matched at the end of the file. The while true do, on the other hand, is not.

#5 ChunLing

  • Members
  • 2,027 posts

Posted 21 October 2012 - 03:26 AM

"while true do break end"...What? It's like you wrote that just to annoy me.

#6 Cloudy

    Ex-Developer

  • Members
  • 2,543 posts

Posted 21 October 2012 - 10:27 AM

You're trying to run code made for LuaPlayer on the PSP without alteration. That isn't going to work. Even if you fix your syntax errors it isn't going to work.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users