Is there by any chance a guide or tutorial on how to understand what I’m actually reading on the wiki? I seem lost at the part where it shows properties, functions, etc. And all the inherited stuff. I tried my best but can’t make out what a lot of it means, and it gets me confused… if anyone here is good at reading the wiki I kindly ask for maybe a few tips or so.
Each wiki page has links in which lead to other wiki pages of the word it’s highlighting if you get stuck.
It should look something like this:
If you don’t see an option like this, it’s probably either because they forget to add it and you can probably just google it. But incase it doesn’t actually have a wiki for it, youtube or other pages are avaliable in which can teach you what it’s about.
Properties of an object are simply that, properties. You can change these yourself, or use them to find
stuff out.
IE: A part has the property transparency, and a Color3 has red, green, and blue measurement properties. You can change them, or find out what they are easily.
Functions of an object can manipulate said object or perform calculations in regard to said object.
IE: CFrame:ToWorldSpace()
can manipulate the given CFrame, changing it from object space to world space, while CFrame:GetComponents()
returns the position and rotation matrix of the given CFrame, and doesn’t change anything.
Events are functions that can be triggered under certain circumstances, like the .Touched
event, for detecting if a part gets touched. If the part is touched, the event fires the function, and it executes whatever action you programmed it to do when the part is touched.
Inherited properties, functions, and events, are just properties, functions, and events inherited from whatever class is given.
IE: “Inherited from Instance” just means that the following properties/functions/events also apply to the Instance class. (Has some of the properties, functions, and events from stuff like Parts, Particle Emitters, etc. Three key examples would be the function :Destroy()
, the property Name
, and the event .AncestryChanged
.
Data types, ie CFrames, Rays, Color3 values, have properties and functions, while instances have properties, functions, and events.
So the core thing to remember about the API reference (which are the pages with the Instances, properties, methods and events) is that’s a really useful information dump. You will have trouble understanding it if you are new to reading documentation and don’t have a clear purpose (a clear purpose might be I want to change a part’s colour, is there a property or method for that?).
Every single piece of information there has a use. So when reading API references it is a good idea to try and understand how you might actually use it. Example: For every value, think to yourself: how might I use a method that does <whatever the method sounds like it does>? This should help you build up the ability to understand this information dump instead of just trying to read a wall of text and being overwhelmed. Read it one step at a time.
Of course, this comes with prerequisite of knowing the basics of scripting in Roblox. Make sure you can do basic things with each of the 3 types (properties, methods and events) before you begin reading the wiki, so you have a frame of reference.
Properties are values that you can change and that will have an effect on the object in some way. Each method does something that might be useful. It will return a value, and it will take some arguments like a normal function, which are defined based on their type. Events are ways to see when something about an object changes or when something happens to it.
Inheritance is kinda like objects being based on other objects. Say you have a Car object. This represents a basic car with 4 wheels, acceleration, steering, etc. This is fine on its own, but it might be more useful if you gave it some specialisation. So let’s say we want to make a Truck object, that works like a car but is designed for heavy lifting like most trucks in real life are. It might have 8 wheels instead of 4, but otherwise not be that much different from a car. It seems like a waste to remake the entire vehicle system from scratch, so what we if we took the work we had done from the Car object and modified it a little so that it is actually a Truck without needing to remake all of that stuff about acceleration and steering? And this is where inheritance comes in – now you have a Truck object that inherits from the Car object because it has basic functionality the truck object requires.
I’m still extremely confused about inheritance. I wish there would be videos about this since I learn a lot more off videos most of the time. I’ll try and make it out myself if I can in the meantime though.
A critical part of learning to script is being able to read the API Reference. Seriously, this thing is jam-packed with information.
I’ll quickly run through what you’ll expect to see on a typical reference page:
Properties
The basic building block of any object. These babies can be referenced simply by doing your_object.PropertyName
. You’ll notice another couple bits:
A) The data type.
Data types can be one of the following:
-
void
(functions): no return type;nil
in Lua -
int
: whole number; an integer -
float/double
: decimal number; a “floating point” -
bool
: a boolean; true or false -
string
: an array of characters -
table
: a Lua table -
Tuple
(functions): multiple values; also known as a “vararg” - Any other Roblox class or data type:
Vector3
,Instance
,InputObject
, etc.
Assigning to a property with the wrong type will throw an error.
B) The name.
If you need more information, you can click the function name to go to its page. Here, you’ll possibly find a code snippet utilizing this property if you’re still confused.
Rule of thumb: Click everything!
C) Property flags.
Ever wondered what the little
[brackettext]
Means? Property flags! Here’s some flags you’ll find along with their meaning:
- [readonly]: a read-only property; will throw an error if assigned to (using
=
)
– ex:Workspace.Terrain = "foo"
These properties will be greyed out in the Properties tab. - [notreplicated]: not replicated across the client-server boundary
- [notscriptable]: similar to readonly, except the property cannot be overridden during gameplay (using a script). Plugins and the Studio editor can, however.
- [hidden]: not shown in the Properties tab; a property only used by a select few developers, so it’s hidden to reduce clutter
- [notbrowsable]: IntelliSense won’t suggest this property, nor will it show in the Properties tab. A property used by either CoreScripts or for debugging [?]
D) The description.
A basic summary of what its purpose is. Like what @ABritishChap said, any highlighted text can be clicked, and you’ll go to its reference page.
Remember: If you need a more in-depth explanation, click the property name to go to its page.
Functions
Functions can be called using your_obj:MethodName(args)
. Functions are very powerful, as they can be given a variety of arguments.
A) The return type.
Functions can return a set of values. As explained above, they have a data type.
Functions can have void
as a data type. Void is nothing. There is nothing to return. Functions of type void
won’t hand you anyhing, but translate to nil
in Lua.
Function returns can be assigned to a variable or passed to another function:
local vec = Vector3.new(10, 20, 30)
TweenService:Create(inst, TweenInfo.new(1), ...)
B) The function name.
Like property names, can be clicked to get a more in-depth explanation.
C) Arguments
Arguments also have a data type! In the above image, the argument instance
has a data type of Instance
(don’t mix up the two). The left side is the type, the right is the human-readable name.
Multiple arguments can be passed to a function, separated by a comma ,
.
print("My favourite number is: ", 10)
Events
Events work the same as properties, except their data type is always RBXScriptSignal
.
Inheritance
In OOP (object-oriented programming), inheritance allows similar classes to inherit properties from others without having to re-write a bunch of code.
Properties and methods can be inherited from ancestor classes. For example:
- a
TextButton
inherits itsPosition
property from theGuiObject
class.- a
VehicleSeat
inheritsCFrame
fromBasePart
.Workspace
inheritsPrimaryPart
fromModel
.- heck, even
StarterGui
inheritsDestroy()
fromInstance
! Doesn’t work, though
Inheritance, simply put, is stealing properties from ancestor classes to save space. They mean absolutely nothing as you, the programmer. It can also be used for maintainability: if a Roblox engineer needed to fix the Destroy()
method, they would only need to edit Instance:Destroy()
to affect ALL inheriting classes, rather than every single object individually.
If any information is missing/incorrect, or if you have any questions, feel free to yell at me. This was typed on mobile, so there’s probably 101 mistakes here.
Hope I helped
TY for the long breakdown, I will try my best understanding what I just read because I honestly feel like I’m too stupid for scripting, I can barely understand too many things. I already know all the basic stuff like for loops functions and tables all that sort of stuff, but anything slightly advanced my brain almost doesn’t work lol. I’m gonna just search vids on YT and learn as much as I can off that (as I’ve learned quite a bit), and maybe refer to ur post in the future, as well as the other posters here.
At the very least, try and learn the different datatypes, and understand the differences between functions, properties, and events.
In terms of importance, inheritance isn’t something you need to worry about too much. The ones listed above are the big names when it comes to doing things with code.
Remember, you don’t have to memorize everything, just get an idea of what each is about, and reference as you go. Soon, you will be able to remember a lot of things off the top of your head.
There’s no such thing as being “too stupid”, some people just learn at different rates. Just practice it and you’ll learn, I promise.