If i want to check if a table has a value you use table.HasValue, correct? Well im not quite so sure how to check if a table has a table within it with a certain value.
Say i have a table
[CODE]
"Table1" {
"AName1" {
"Value1" "1"
"Value2" "2"
}
"AName2" {
"Value1" "1"
"Value2" "2"
}
}[/CODE]
Now if i use table.HasValue(Table1, "AName1") it sends back that it doesnt have that value. From what ive read its because they have to be the same type, AName1 would technically be a table so im trying to compare a string to a table which will say, nope nothing exists.
The table is for a team list thing and looks like this when players add a new team:
[CODE]"Out"
{
"Test Team 1"
{
"locked" "No"
"creator" "(FES) Tissue /e"
"Players"
{
"1" "STEAM_0:0:0"
}
}
}[/CODE]
I have another table that stores the values as it gets it after displaying it in the DListView (cause everytime it loads it AddItems(teamname), and if you didnt store the already loaded ones it just keeps adding it over and over), I need to then check if the team ever gets removed, and then remove it from the DListView.
[CODE]LoadedTeams = { "Test Team 1" }
for k,Name in pairs(LoadedTeams) do
if table.HasValue(TeamList, Name) then
print("We've Got it!")
else
print("nope")
end
end[/CODE]
Always prints nope.
Ik, i have a lot of table questions. I apologize.
I'm not sure, but I think you can just do if Table1.AName1, if it exists it should basically be the same function as HasValue. Otherwise it'll return nil. Not sure if that will work.