|
| 09 Jul 2011 09:57 PM |
Im trying it, it says Function arguments expected near '='
hum:Sit = function() loadstring([[hum.Sit = true]])() end
Tagged the 'hum'. |
|
|
| Report Abuse |
|
|
| |
|
|
| 09 Jul 2011 10:00 PM |
| Ya, i forgot >:/ I haven't done any scripting in lua for a while. I was concentrating on C++ for a while >_> |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 10:01 PM |
function set(O) return setmetatable({ Sit = function(self) self.Sit = true end}, {__index = function(t, k) if pcall(function() return O[k] end) then if type(O[k]) == "function" then return function(tab, ...) return O[k](O, ...) end else return O[k] end end end, __newindex = function() print'No' end, __metatable = { "LOLNO" }}) end set(hum)
hum:Sit() ----> NO ERROR :D:D:D |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 10:02 PM |
Oops...
function set(O) return setmetatable({ Sit = function(self) self.Sit = true end}, {__index = function(t, k) if pcall(function() return O[k] end) then if type(O[k]) == "function" then return function(tab, ...) return O[k](O, ...) end else return O[k] end end end, __newindex = function(t, k, v) O[k] = v end, __metatable = { "LOLNO" }}) end set(hum)
hum:Sit() ----> NO ERROR :D:D:D |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 10:03 PM |
| Im going to smack you if you dont simplify it, or give me a link to what that means. I appearently never learned that >_> |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 10:04 PM |
ARGH ANOTHER ERROR!!!
function set(O) return setmetatable({ Sit = function(self) self.Sit = true end}, {__index = function(t, k) if pcall(function() return O[k] end) then if type(O[k]) == "function" then return function(tab, ...) return O[k](O, ...) end else return O[k] end end end, __newindex = function(t, k, v) O[k] = v end, __metatable = { "LOLNO" }}) end hum = set(hum)
hum:Sit()
That's as simple as you can get. It's using metatables in a very... strange way, but it's valid. :P |
|
|
| Report Abuse |
|
|
Spectrumw
|
  |
| Joined: 04 Aug 2009 |
| Total Posts: 13510 |
|
|
| 09 Jul 2011 10:06 PM |
@AFF Congratulations, you just won the nobel prize in medicine because of proving that brains can actually melt. |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 10:06 PM |
I GET WHY YOU POSTED THIS NOW!
I'm a little slow... sometimes... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 11:00 PM |
| My brain didnt melt...it imploded... |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 11:06 PM |
ZOMG
WE ALL BE SUCKED INTO THE BLACK HOLE WE CALL phoenix's BRAIN!!! AHHHHHHHH!!$@% |
|
|
| Report Abuse |
|
|
|
| 09 Jul 2011 11:24 PM |
| No >:/ Because my mind is already a black hole, or what i think to be a cosmic vortex. Which is infinitely expanding and contracting to store more data >:3 Except people dont know yhow much i know, because of a screen blocking all data from that point and beyond......Which all of it is a reference to the universe :D |
|
|
| Report Abuse |
|
|