Jump to content




Trouble With Using Another File's Content

game computer help

2 replies to this topic

#1 Dayrider10

  • Members
  • 32 posts

Posted 24 April 2014 - 12:56 AM

Hey Everyone!

The title may be confusing ,but here is my problem and all. I want it so that I can open the file called "player.info" and use the contents and put them in a table that have which is tankInfo. What happens is that when it goes to draw the tank it reports back an expected number error. For example if I assigned the color in the tankInfo table to playercolor which is in the file we opened it says an expected number. Yes I have tried tonumber. Here is the pastebin code;

Here is the main code:

http://pastebin.com/3cVTthJh

Here is the contents of the file:

http://pastebin.com/WFzXi43K

From lines 90 - 97 opens the player.info file. From lines 115 - 123 is the table with the tank and in the player.info file (the second link) it is from lines 3 - 8.

Thanks!
Live On!

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,459 posts

Posted 24 April 2014 - 01:14 AM

You should store just the color name, then use colors[handle.readLine()] to get the number.

#3 Dayrider10

  • Members
  • 32 posts

Posted 24 April 2014 - 11:36 AM

Thanks Lyqyd! It worked like a charm!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users