Table values help

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!

Im new to tables and trying to save values under a different name in a table, kind of like a variable

basically, im trying to save a value to a players name in a table
im trying to search the name of a player, and get the value listed underneath the players name

for instance:

table = {player = "value"} 

and get “value” from searching player

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

this is what i tried, of course it doesent work, but when i search “player” in the table.find, i would like it to return the value

local tabled = {
	player = "value"
}

print(table.find(tabled, "player"))

i apologies for anything wrong
and do ask if you need more details

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

1 Like
local tabled = {
	player = "value"
}

print(tabled["player"])

2 Likes

I honestly can belive its that simple and that ive been searching for hours.
but anyways thank you!

2 Likes

and sorry for the double reply/question but
would there be a way to insert a similar “variable” into the table?
for instance inserting

player = “value”

into the table
sorry again

1 Like
local tabled = {
	player = "value"
}

print("1", tabled)

tabled["player2"] = "value2"

print("2", tabled)

image

or just tabled.player2 = “value2”

2 Likes

Tables are a lot simpler then i thought!
this should be my last reply, and for the third time, thank you

2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.