Condition with a table.

Hi.
I want to do a condition clientside on a table shared.
(Okay, I know, that’s not clear…)

This is my code:
Shared
[lua]
data = {}
function StoreData(table, name)

data[name] = table

end

mytable{}
mytable.username = Marc0303
mytable.password = Something
StoreData(mytable, “exemple”)
[/lua]

Clientside
[lua]
function ShowData()
–I want to put my condition here
–like:
if (data[exemple].password == something) then --That’s what I want to know (because this doesn’t wok)
end
[/lua]

Note: This is NOT to do something with an username/password.

First of all you have an error in your code.

[lua]mytable{} – Wrong
local mytable = {} – Correct[/lua]

Also:

[lua]data[exemple] – exemple is nil, this won’t work
data[“exemple”] – this, however, should work.[/lua]

If you are trying to network data like this, it won’t work. The shared code is not actually “shared” between the client and server, they both have their own copy of it.

So, how I can do this?

You need to use Usermessages to send the data to the client.

Here is a tutorial from the wiki.

EDIT: Ok Fix!