Scripts / Need help with script

Author
Message
viomusicstudi
7
Years of Service
User Offline
Joined: 16th Jun 2016
Location:
Posted: 21st Jun 2016 15:19 Edited at: 21st Jun 2016 15:25
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

PM
viomusicstudi
7
Years of Service
User Offline
Joined: 16th Jun 2016
Location:
Posted: 21st Jun 2016 17:02 Edited at: 21st Jun 2016 17:37
I just tried to change coins number to 21 in cartoon game. It works. But in another level, let"s say new one, doesn't work.
I have assigned coincountstart.lua to trigger zone on start, coindisplay.lua to one flower object, startdisplay.lua to another flower object and coincollect.lua to coin object.

Never mind I found the solution. Script doesn't work if script file is not in the cartoon folder.
PM

Login to post a reply

Server time is: 2024-05-04 11:34:34
Your offset time is: 2024-05-04 11:34:34