Condition with a table.

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

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

data[name] = table


mytable.username = Marc0303
mytable.password = Something
StoreData(mytable, “exemple”)

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

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]


[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!