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 » Scripters
Home Search
 

Re: rapping

Previous Thread :: Next Thread 
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 05:59 PM
ok i have my nooby wrapper here:

function Wrap(object, tab, lock)

local new = setmetatable(tab, {__index = object})

local proxy = newproxy(true)
local mt = getmetatable(proxy)
mt.__index = new
mt.__newindex = function(t,i,v)
if new[i] then
new[i] = v
else
error(v.." is not a valid member of "..i)
end
end
if lock then
mt.__metatable = "Locked, noobs"
end

return proxy
end

it works and all, but i cannot use roblox created methods like :WaitForChild() or something
how kan i do it
Report Abuse
AbstractMadness is not online. AbstractMadness
Joined: 22 Dec 2014
Total Posts: 20425
17 Jun 2015 06:00 PM
are you a rapper
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 06:01 PM
im an adapter
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 06:09 PM
eminem come help
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 06:25 PM
wwww
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 06:58 PM
plese rap mast3rs
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
17 Jun 2015 07:00 PM
tracking this cuz i need to know this 2
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
17 Jun 2015 07:01 PM
Actually... you are doing it wrong. You index through the userdata created.
It should fizzle.

local Object = {}

Object.new = function()
local this = {}

local proxy = newproxy(true)
local proxy_meta = getmetatable(proxy)

proxy_meta.__index = this
proxy_meta.__newindex = function(self, i, v)
--TODO: Checked if allowed to set or whatever
end

return proxy
end

return Object
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 07:04 PM
it works for me

the userdata is relaying the request to the table i want to add, which'll hold all the extra stuff i add to my wrapper
if the table doesn't contain it, then it'll relay it to the original object to see if it has that thing
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
17 Jun 2015 07:30 PM

You misunderstand the concept of userdata.

Since this is Lua 5.1, the reason we use userdata like this is to filter what the table contains and how it is interacted with.

Call really shouldn't be on an array or a metatable... it should be an objects methods
Add really shouldn't be on an array or a metatable... it should be an two objects

Since we have a filter letting you decide what can happen, it is easier for error() checking, locking variables to prevent errors, setting a normalization of units, and more.... since everything fizzles to the __index and __newindex...

Metatable allows you to set certain methods to happen in the environment, not store data.

http://www.lua.org/pil/28.1.html

Gives a good example of using programming with Lua and not plain Lua. It has more versatility through programming, naturally.

Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 07:32 PM
ok tl;dr
but it works so im good
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
17 Jun 2015 07:34 PM
You've lost all respect for me and now I will never help again.
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
17 Jun 2015 07:37 PM
I think you mean, "I've lost all respect for you"
pls i sory
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
17 Jun 2015 07:38 PM
You've lost all respect from me and now I will never help again.*
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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