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: Wrapping

Previous Thread :: Next Thread 
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
20 Jan 2016 12:18 PM
Example of wrapping an object such as humanoid ?
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
20 Jan 2016 12:36 PM
bump
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
21 Jan 2016 03:44 PM
bumpx2
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2016 03:45 PM
I recommend against wrapping. It is inefficient, and they are pretty hard to make. If you learn metatables, then that's all you really need to know. They can make code quicker to do though.
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
21 Jan 2016 03:46 PM
Then how would I use metatables ?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2016 03:50 PM
__index, __newindex
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
21 Jan 2016 03:52 PM
Humanoid is a DataModel, I can't just attach a metatable to it and using one of it's function "newindex". Can you kinda give me a more in depth example ?
Report Abuse
JarodOfOrbiter is not online. JarodOfOrbiter
Joined: 17 Feb 2011
Total Posts: 20029
21 Jan 2016 03:54 PM
local Wrapped = setmetatable({kill = function(self) self.Health = 0 end}, {__index = Humanoid})

Wrapped:LoadAnimation(Blah)
Wrapped.Health = 100
Wrapped:Kill()
Report Abuse
iSymon is not online. iSymon
Joined: 19 Nov 2011
Total Posts: 1023
21 Jan 2016 03:56 PM
Thanks.
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