Posted 11 August 2013 - 12:01 AM
So I have this code, here it is
function tableCheck(yolo, swag)
tries = 0
for i = 1, #yolo do
if yolo ~= swag then
tries = tries + 1
end
end
end
now, i thought that doing a print(tries) would output the number of swag in the table yolo, but it only seems to output the second to last number in the table. what should I do to accomplish my goal of having a variable to represent the number of swag in table yolo?
also, I edit this code to return false if tries == #yolo else return true, so i know this works, this lets me check a table for a variable. that way
I can check entire tables of variables for another variable and that way i can update player detector doors easily :D/>/> its pretty cool. anyway please help me solve this problem.
function tableCheck(yolo, swag)
tries = 0
for i = 1, #yolo do
if yolo ~= swag then
tries = tries + 1
end
end
end
now, i thought that doing a print(tries) would output the number of swag in the table yolo, but it only seems to output the second to last number in the table. what should I do to accomplish my goal of having a variable to represent the number of swag in table yolo?
also, I edit this code to return false if tries == #yolo else return true, so i know this works, this lets me check a table for a variable. that way
I can check entire tables of variables for another variable and that way i can update player detector doors easily :D/>/> its pretty cool. anyway please help me solve this problem.