Hi,
when running door:getKeysCoOwners() it returns a table, does anyone know how to get the names from the table, i have tried door:getKeysCoOwners()[1] but this just gives errors
if anyone can help, that would be great.
Thanks
You should be able to use table.HasValue or table.GetKeys
so
table.GetKeys(door:getKeysCoOwners())
Im creating a hud for the doors on darkrp.
I want to be able to show everyone that co owns the doors
table.GetKeys() worked for me,
for _, id in pairs(table.GetKeys(v:getKeysCoOwners())) do
if Player(id):IsValid() then
if !table.HasValue(coowners, Player(id):Nick()) then
table.insert(coowners, Player(id):Nick())
end
end
end
Thank you
for id in next, v:getKeysCoOwners() do
local ply = Player(id)
if (IsValid(ply) and not table.HasValue(coowners, ply)) then
table.insert(coowners, ply)
end
end
Sorry, you need to Log In to post a reply to this thread.