Hi! I want to make one game with collecting objects. I used script from cartoon game, in coindisplay.lua II have changed 100 with 21 because I want only 21 coins in first level. Everything woks well but when I collect the last coin nothing happens. What is the problem?
function coindisplay_init(e)
end
function coindisplay_main(e)
SetImagePosition(50,10)
ShowImage(0)
PromptTextSize(5)
Prompt (" " .. 21 - CoinCount .. " more to collect!" )
if CoinCount==21 then
HideImage(1)
FreezePlayer()
SetImagePosition(50,50)
ShowImage(3)
if g_KeyPressE == 1 then
UnFreezePlayer()
HideImage(3)
FinishLevel()
Destroy(e)
end
Prompt("Press E to close or Esc to end level.")
end
end