generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Function help

Previous Thread :: Next Thread 
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 09:58 PM
*giant grin*
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
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 is not online. 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
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 10:06 PM
I GET WHY YOU POSTED THIS NOW!

I'm a little slow... sometimes...
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
09 Jul 2011 11:00 PM
My brain didnt melt...it imploded...
Report Abuse
AgentFirefox is not online. AgentFirefox
Top 100 Poster
Joined: 20 Jun 2008
Total Posts: 22404
09 Jul 2011 11:06 PM
ZOMG

WE ALL BE SUCKED INTO THE BLACK HOLE WE CALL phoenix's BRAIN!!!
AHHHHHHHH!!$@%
Report Abuse
phoenix53124 is not online. phoenix53124
Joined: 25 Feb 2009
Total Posts: 4889
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image