This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Dr_Zarreh's profile picture

[Lua] attempt to perform arithmetic on a string

Started by Dr_Zarreh, 11 May 2012 - 05:35 PM
Dr_Zarreh #1
Posted 11 May 2012 - 07:35 PM
[Solved!!]



cats = {10,11,12,8,100}
for i,v in ipairs(cats) do
t = "#cats"
print(v/t)
end

how would i fix it? I've been trying various formats and this was my latest one. if you're wondering why cats, im just messing around and learning lua..
Hawk777 #2
Posted 11 May 2012 - 07:44 PM
Get rid of the quotation marks around #cats.
Dr_Zarreh #3
Posted 11 May 2012 - 07:50 PM
ty now i just need a simple addition script to finish it…