Still have questions? Join our Discord server and get real time help.
1

How would I combine tables?

M39a9am3R 3152
5 years ago

I am trying to make a admin command script (I know ROBLOX has a ton of them) but I am wondering if it is possible to combine two tables for the script to look through at the same time? I am wanting to make a basic command such as kill and not have two chunks of a script to go through to run the command.

--All but my username is made up by the way.
local Moderators = {"Crazy","Mod1","gMod","Lol"}
for _,v in pairs(Administrators and Moderators) do
print(v) --I made this so I could test the script to see if it will run through both tables.
end

0
test M39a9am3R 3152 — 3y

0
5 years ago

You have to run each loop separately, there's no way around that with how you've set up your permissions.

A solution to this is to create a combined Table for both Admins and Mods, which you can do easily, like so:

local Administrators = {"M39a9am3R","Xaphier","MarxTheSpot","Coolio"}
local Moderators = {"Crazy","Mod1","gMod","Lol"}