|
| 12 Mar 2014 10:28 AM |
If I declare a global variable in a plugin, when they click it, can it be accessed by scripts? Example;
self = PluginManager():CreatePlugin() toolbar = self:CreateToolbar("The Ultimate List Of Functions") toolbarbutton = toolbar:CreateButton("TULOF", "The Ultimate List Of Functions") toolbarbutton.Click:connect(function() print("Type _G.Ultimate() for help") _G.Variable = "HI WORLD" end)
Or better yet, can I declare without them clicking it?
self = PluginManager():CreatePlugin() toolbar = self:CreateToolbar("The Ultimate List Of Functions") toolbarbutton = toolbar:CreateButton("TULOF", "The Ultimate List Of Functions") _G.Variable = "HI WORLD" toolbarbutton.Click:connect(function() print("Type _G.Ultimate() for help") end)
Would the second one work? If not would the first? |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2014 10:29 AM |
@title... Global -_-
Post.Parent.Title.Text = "Global variables in a plugin" |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Mar 2014 11:38 AM |
| Please? Do none of you have experience with plugins? Also, why does it always take 3 bumps before you guys answer my question? |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 12 Mar 2014 11:44 AM |
| Nope, plugins have their own environment pretty sure |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2014 11:55 AM |
| Seriously? That sucks. How can you change the source of a script, I guess I will have to insert it. But if this does work, you can still feel free to help me by saying so! |
|
|
| Report Abuse |
|
|
janthran
|
  |
| Joined: 15 May 2009 |
| Total Posts: 17429 |
|
|
| 12 Mar 2014 12:03 PM |
Wait, I just tested and yes, you can set _G from a plugin and access it from scripts/cmdbar sorry |
|
|
| Report Abuse |
|
|
|
| 12 Mar 2014 12:38 PM |
| Thanks, do you have to click to access it? |
|
|
| Report Abuse |
|
|
| |
|
|
| 12 Mar 2014 05:32 PM |
| Do I have to click to assign the global variables? Or can I do it without the click function? |
|
|
| Report Abuse |
|
|
| |
|
|
| 13 Mar 2014 11:03 AM |
YOU KNOW WHAT. IM JUST UPSET, SO UPSET IM GONNA MAKE MEANINGLESS BUMPS!
B1 |
|
|
| Report Abuse |
|
|
Cawlonee
|
  |
| Joined: 03 Mar 2014 |
| Total Posts: 2687 |
|
|
| 13 Mar 2014 11:21 AM |
Sorry, I don't know what Globa is.
Is it a new Pokemon? |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2014 11:31 AM |
| View second reply, I meant global |
|
|
| Report Abuse |
|
|
Cawlonee
|
  |
| Joined: 03 Mar 2014 |
| Total Posts: 2687 |
|
|
| 13 Mar 2014 11:32 AM |
That was joke.
//joke --See |
|
|
| Report Abuse |
|
|
trogyssy
|
  |
| Joined: 29 Oct 2010 |
| Total Posts: 2322 |
|
|
| 13 Mar 2014 11:33 AM |
Ooh , Globa. Sounds interesting.
~~trogyssy, Scripting Helper and S&I Activist~~ |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
| |
|
| |
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
|
| 13 Mar 2014 12:35 PM |
| yes u can just put it before click function |
|
|
| Report Abuse |
|
|
|
| 13 Mar 2014 12:42 PM |
| They will be able to access them? |
|
|
| Report Abuse |
|
|
robotmega
|
  |
| Joined: 16 May 2009 |
| Total Posts: 14084 |
|
| |
|
| |
|