• Meta to client
    3 replies, posted
Is there a way of connecting a shared meta to the client? For example I'm trying to do this: ON SHARED [lua]local meta = _R.Player("Player") --Get the meta table of player function meta:GetMoney() return self:GetNetworkedInt( "Money" ) end[/lua] ON CLIENT [lua]label:SetText("Arsenal. Money: "..LocalPlayer():GetMoney())[/lua]
Your code already works. [editline]08:34PM[/editline] Wait, actually it doesn't. [lua]local meta = _R.Player("Player")[/lua] The hell is this? :v: Those are two different ways to get a metatables, but they do the exact same thing, don't get confused between them. [lua]local meta = _R.Player local meta = FindMetaTable("Player")[/lua]
_R.Player is better because it accesses it directly while findmetatable searches through all the tables. And no it doesn't work. :/
[QUOTE=Jackthemaster;23711138]And no it doesn't work. :/[/QUOTE] It should. Make sure your shared file is included before you actually use your custom function. LocalPlayer() also does not exist immediately when the game starts, so make sure you check its validity.
Sorry, you need to Log In to post a reply to this thread.