Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

table.remove problems? Help?

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)

2 comments

0

Could you update the post with the output?

0

There is no output error from it.

2 answers

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

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

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,_)

This discussion is preserved as it was. New answers, comments, and votes are closed.