Skip to content
This repository has been archived by the owner on May 11, 2020. It is now read-only.

Commit

Permalink
fix: attempt to index ? (a nil value)
Browse files Browse the repository at this point in the history
When a new player logged into the game the game crashed and showed
the above error as the message. The reason for this is due to not
having the default learning course (which is "" - nothing) in the
courses table
Fixed that error
  • Loading branch information
Seniru committed Jan 10, 2020
1 parent bbc31cc commit d669394
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion game.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1007,7 +1007,9 @@ function setUI(name)
ui.addTextArea(4, "<a href='event:shop'><b><font color='#000000' size='15'>Shop</font></b></a>", name, 100, 230, 50, 40, nil, nil, 0, false)
--school button
ui.addTextArea(5, "<a href='event:courses'><font size='15'><b>Enter</b></font></a>", name, 600, 270, 60, 20, nil, nil, 0, false)
ui.addTextArea(3000, "<p align='center'><b>Lessons left: " .. p:getLearningProgress() .." / " .. courses[p.learning].lessons .. "</b></p>", name, 480, 180, 300, 20, nil, nil, 0, false)
if not p.learning == "" then
ui.addTextArea(3000, "<p align='center'><b>Lessons left: " .. p:getLearningProgress() .." / " .. courses[p.learning].lessons .. "</b></p>", name, 480, 180, 300, 20, nil, nil, 0, false)
end
--jobs button
tfm.exec.addImage("16f88c66ed1.png", ":10", 610, 25) -- Job search image by Freepik in 'Flaticon.com'
ui.addTextArea(6, "<a href='event:jobs'>\t\n\t\n\t\n</a>", name, 610, 25, 30, 30, nil, nil, 0, true)
Expand Down

0 comments on commit d669394

Please sign in to comment.