• Help with getting NW var from function
    6 replies, posted
I have an entity when your press E at, it opens you a DFrame that has a Button in it. Now, when you press that button it goes to a function in the init file, problem is, I need access for a self:GetNWInt("name") inside that function :\ [CODE]function GetValue(pl, cmd, args) --The inside dosent matter at the moment end concommand.Add("GiveMeMyValue", GetValue)[/CODE] and this is my Do Click function [CODE] button.DoClick = function() LocalPlayer():ConCommand("GiveMeMyValue") end [/CODE] I've been at it for 2 hours now, asking 2 different people that referred me to each other. Any help will be great. (All of these are from the entity folder, sorry for the english and for not being specific enough)
Is this what you mean? [code] local meta = FindMetaTable("Player") function GetValue(pl, cmd, args) meta:GetNWInt("name") end concommand.Add("GiveMeMyValue", GetValue) [/code]
E in Game? You can try to Reinstall Rust and download it again ? Might Help? If not um you wasted money :(
[QUOTE=Haskell;44277845]Is this what you mean? [code] local meta = FindMetaTable("Player") function GetValue(pl, cmd, args) meta:GetNWInt("name") end concommand.Add("GiveMeMyValue", GetValue) [/code][/QUOTE] Not quite, let me try to rephrase it. I have a function inside my entity's init file. The function is being called by clicking a button, then, the button sends a console command that will do what I want , the problem is, that inside that function I can't get my NW variables because its not an ENT:Blabla function, i'm not sure how to say it. Anyway's, how can I make the function get the NW var (I need to change it afterwards too).
So you're networked string is under the entity meta table? Why don't you tell me what you are trying to do. This will work if you do this, ( I think ). [code] meta = FindMetaTable("Entity") [/code] But I'm not sure, so you can't qoute me here.
[QUOTE=Alia14Ful;44277855]E in Game? You can try to Reinstall Rust and download it again ? Might Help? If not um you wasted money :([/QUOTE] What are you smoking.
[QUOTE=Haskell;44277978]So you're networked string is under the entity meta table? Why don't you tell me what you are trying to do. This will work if you do this, ( I think ). [code] meta = FindMetaTable("Entity") [/code] But I'm not sure, so you can't qoute me here.[/QUOTE] It works perfectly, thank you so much :) edit: It dosent give me the real values, sorry.
Sorry, you need to Log In to post a reply to this thread.