Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

is it possible to remove a value from an array using its value?

Asked by 8 years ago
local t = {1,potato,2,3,4}
table.remove(t,1) --removes first position of the array
-- i was wondering if it was possible to remove potato without using table.remove(t,2), could i remove potato using the word itself (potato)?

thank you

1 answer

Log in to vote
0
Answered by 8 years ago

table.remove will be expecting a number value in its parameter so that likely won't work syntax wise. That being said there is more than likely a way to remove it from the table but I'm personally not too sure on the syntax for it. If I find anything while reading about it I'll message you.

Ad

Answer this question