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: [RELEASE] Class Service

Previous Thread :: Next Thread 
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
12 Oct 2015 09:48 PM
I just made a module which allows you to have classes in your scripts.

Link:
http://www.roblox.com/ClassService-Classes-in-RBX-Lua-item?id=305968706

An example:

require(305968706)()

class CreatePerson{
Name="";
Age=1;
}

CreatePerson Jack;
Jack.Name="Jack"
Jack.Age=15
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Oct 2015 09:48 PM
now add inheritance!1 and static members
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
12 Oct 2015 09:49 PM
I beat you to that already. -_-


http://www.roblox.com/--item?id=130759239
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 09:49 PM
I don't really get the point of this, sorry


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
12 Oct 2015 09:50 PM
@cnt,o
Report Abuse
Immacularity is not online. Immacularity
Joined: 21 Jun 2014
Total Posts: 419
12 Oct 2015 09:55 PM
Mine uses custom userdatas that allow you to add and edit values and also lets you customize the length and call metamethods. It's basically a replicator of ROBLOX's instance system without a ton of limitations and irritating "you can't call this because we said so" blocks.


http://www.roblox.com/--item?id=130759239
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 09:57 PM
I have a question, what does this actually do, I'm confused


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
bloodmachete is not online. bloodmachete
Joined: 17 Apr 2010
Total Posts: 41
12 Oct 2015 10:01 PM
And.. how does it work exactly?
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
12 Oct 2015 10:08 PM
If you know a programming language you should probably know what classes are.

Anyways @cnt, I just finished the inheritance part, example:

class Person{
private={
Dead=false;
};
public={
Name="Hello"
}
}
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 10:08 PM
I know roblox programming and I never heard of it :) (Do you mean like type?)


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
12 Oct 2015 10:09 PM
http://www.tutorialspoint.com/cplusplus/cpp_classes_objects.htm
Report Abuse
Dogejia is not online. Dogejia
Joined: 08 Feb 2012
Total Posts: 1873
12 Oct 2015 10:12 PM
So its ClassName ._.


gcmi lg lpxtlc; Decode it with Vigenere Cipher, keyword is Doge, if you dare >:)
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
12 Oct 2015 10:38 PM
@cnt, I ignored static since I can just do:

class Person{
Name="Yolo";
Count=0;
Add=function()Count=Count+1 end
}
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
13 Oct 2015 09:24 PM
Made an update, now a __call tag.

class "Person"{
__call=function(args)
print(table.concat(args,", "))
end;
}

Person "Jack"{"Hello","Test",1,3,"Ahh ye"}
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
13 Oct 2015 09:29 PM
Tynezz
What gets me is how you can do class Person {}
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
13 Oct 2015 09:31 PM
@cody, I could change it..
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
13 Oct 2015 09:32 PM
What?

Is the proper syntax:

class Person {

}

or

class "Person" {

}
Report Abuse
Tynezz is not online. Tynezz
Joined: 28 Apr 2014
Total Posts: 4945
13 Oct 2015 09:32 PM
class "Person"{
}
Report Abuse
kools is not online. kools
Joined: 11 Jan 2009
Total Posts: 1659
13 Oct 2015 09:37 PM
Someone over at the LOVE2D community made a class system in lua that I throughly enjoy. Google 32 lines of goodness.
Report Abuse
cody123454321 is not online. cody123454321
Joined: 21 Nov 2009
Total Posts: 5408
13 Oct 2015 09:41 PM
'swat I thought.

Defining a class should have this:

constructor
deconstructor
public and private fields
polymorphism
methods
a delete command that executes deconstructor then erases from memeory

class "Example" { --this would getfenv()["Example"] = this
Example = function(self, a, b, c)
self.a = a;
self.b = b;
self.c = c;
end;
~Example = function(self)
self:save(self.b)
end;
public = {
save = function(self, i)
Datastore:SetAsync("abc", i)
end;
};
private = {

}
}

local ex = Example.new() -- invoke constructor and stuff, all in the class
class.delete(ex) -- or getfenv()["delete"] = function() to delete stuff end
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