I have a serverban button with inputs and insert it using this:
table.insert(serverBans,tonumber(targetUser),"You have been server banned by "..tostring(submittedBy).." for: "..reason)
But how would I remove that? I can’t figure out how to use table.remove correctly as every time I’m trying it there isn’t any errors but it just doesn’t work.
table.remove(index number here) (I’m pretty sure) I almost never use tables /: Also, index numbers are pretty much numbers for each code seperation you have in your script. so for example
server bans is index 1 tonumber is index 2. it’s being seperated by the , you placed on each code inside the table.
You can simply just find the index by using table.find, you don’t have to loop thru everything in there: table.remove(serverBans, table.find(serverBans,tonumber(userid))) –
table.find(serverBans,tonumber(userid)) returns index of userid in the table.
table.insert(serverBans,tonumber(targetUser),"You have been server banned by "..tostring(submittedBy).." for: "..reason)
i use this to insert it into the table yet it says there isnt one but it manages to kick them if they’re part of the table but doesn’t remove it when you press unban