|
| 04 Mar 2017 11:19 AM |
How do I make a new custom object type?
object car (string name, int speed)
so for example I could do this: car:Drive() |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 11:21 AM |
| ### use tables to declare objects. local car = {} function car:Drive() end |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 11:25 AM |
How would I define a "international" function
CalledOn:DoThis()
? |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 11:26 AM |
http://wiki.roblox.com/index.php?title=Object-Oriented_Programming
|
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 11:27 AM |
Oh, just like modulescripts? Alright.
So how does roblox make the functions have :?
So everything is an instance, and :GetChildren() is a part of "instance"? |
|
|
| Report Abuse |
|
|
|
| 04 Mar 2017 11:29 AM |
The colon is syntactic sugar. But yes, that is true.
|
|
|
| Report Abuse |
|
|
cars37
|
  |
| Joined: 27 Nov 2013 |
| Total Posts: 189 |
|
|
| 04 Mar 2017 11:38 AM |
| If you really want to create an object, you need to do "object = newproxy(true)". Roblox calls this an object. |
|
|
| Report Abuse |
|
|