Anybody can help me about understanding basic OOP thingy?

how can i make basic OOP thingy ?

Come on man. You really think this thread is going to go anywhere with a title like that.

i dont know dude xD :grinning:

The search feature is pretty useful for that. Try searching for OOP or Object Oriented Programming. A really good one is this: All about Object Oriented Programming


Here’s an example of a Class using an Object Oriented style in Luau form.

local Account = {
	balance = 0
} = {
	__index = Account

	local self = setmetatable({},
	self.balance = balance
	return self

function Account:Withdraw(amount)
	self.balance = self.balance + amount

function Account:Deposit(amount)
	self.balance = self.balance - amount

local a1 =
local a2 =
print(a1.balance) --> outputs 0
print(a2.balance) --> outputs 100

Reading through the Metatables article should help you as well.

1 Like