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

table.remove problems? Help?

Asked by 10 years ago

I looked on the wiki it didnt help me much to remove strings from the table... :/

Any idea's?

Owners={'MessorAdmin'};

Instance_CMD('Unadmin',1,function(Plr,Msg)
for _,v in pairs(FindReturnPlayer(Plr,Msg)) do -- Returns a table
----------------------------------------------  
for _,p in pairs(Owners) do
if p:lower()==v.Name:lower() then print(p) -- Returns my name from the FindPlayerTable return.
table.remove(Owners,_) wait()   -- This is the error line. Im not sure why its not removing my name.
Note(Plr,'Removed '..Msg..' Admin!',(85/255/0)) -- This outputs after but my name is not removed?!?!?
end
end
---
end
end)
0
Could you update the post with the output? VariadicFunction 335 — 10y
0
There is no output error from it. MessorAdmin 598 — 10y

2 answers

Log in to vote
2
Answered by 10 years ago

You have two indexes of _. Hope that helps you out.

*Add an end before you do the other _, whatever in pairs

Ad
Log in to vote
0
Answered by 10 years ago

table.remove() needs 2 arguments: the table, and the position of the thing we're removing. So, do table.remove(Owners,#_) instead of table.remove(Owners,_)

Answer this question