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

Why aren't table inputs being removed?

Asked by 9 years ago

This script is shortened and I'm trying to remove a picked table input from the table (RaresTable is the table).

Can someone please help me? This third line is the line with a problem.

local RaresDecided1 = RaresTable[math.random(1,#RaresTable)]
print(RaresDecided1)
**table.remove(RaresTable, RaresDecided1)**

1 answer

Log in to vote
1
Answered by
Uglypoe 557 Donator Moderation Voter
9 years ago

When using table.remove(), it requires two parameters: the table an item is being removed from and the position the item being removed is at in the table.

For example, look at this:

example = {"yo","hi","sup"}

table.remove(example, 2)

This code would remove "hi" from the table "example".

Ad

Answer this question