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

problem with table.remove??

I dont have any error, but why would the table.remove not be removing the player's name?

Pet(Plr,'Deep orange','Clear PrivateServer List?',function()
Dismiss(Plr)
local Run,Error = ypcall(function()
for i = 0,#Dergan['PrivateServer_People'],1 do
table.remove(Dergan['PrivateServer_People'],i[1])
end
end)
if not Run then Pet(Plr,'Deep orange','WARNING : '..Error,function() end) end
Dismiss(Plr)
Pet(Plr,'Lime green','Updated Private Server List!',function() end)
Pet(Plr,'New Yeller','Back',function() GetPrivateServer(Plr) end)
end)

1 answer

✓ Accepted answer

I'm not really sure what you're trying to do here, but the easiest way to clear a table is to just set it to an empty one. Also, format your code bro. Untabbed code is difficult to read.

Pet(Plr,'Deep orange','Clear PrivateServer List?',function()
	Dismiss(Plr)
	local Run,Error = ypcall(function()
--	for i = 0,#Dergan['PrivateServer_People'],1 do
--		table.remove(Dergan['PrivateServer_People'],i[1])
--	end
	Dergan['PrivateServer_People'] = {}
end)
if not Run then Pet(Plr,'Deep orange','WARNING : '..Error,function() end) end
Dismiss(Plr)
Pet(Plr,'Lime green','Updated Private Server List!',function() end)
Pet(Plr,'New Yeller','Back',function() GetPrivateServer(Plr) end)
end) --?

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