#Lua OOP
1 messages · Page 1 of 1 (latest)
depends
I meant for a well structured game, OOP is something i would always recommend
But idk for Lua
i use OOP everywhere, but it depends like he said
** You are now Level 2! **
I get it for the depends but for overall use it is recommeded.
For playerdata saving it would also be recommended
I would guess
i use OOP only for system, like combat system, or other system, but if it for dataStore i use community lib, like ProfileStore (it's just a exemple)
i see i should start to look more into lib's always was using my own
Creating my own storage system
profile store mentioned 🔥
datastore - profile store
signals - lemon signal (bindable events are ass)
you can use zoneplus if you dont want to write a spatial query
Do you also have a good site or somewhere i can buy vector icons?
🔥
I found a site but they require a licence after buying it, found it a bit scummy
you talk about parcel?
ah my bad
there are free pack for icon like this, like icon for simulator
Thank you for the help, didnt really think that OOP was used in LUA
OOP is EVERYWHERE!!! x)
Yes but i rather found them really small file size or they are just 1 style
Thats why i tried to find some paid ones, might offer some variety
sorry i can't help you on that, i don't know many market website
When i first started to script on lua i couldn't comprehend that you dont need a main
That was so confusing for me
That it has multiple entry points instead of the normal 1
one moduleScript is for one thing about a system, and you need a loader because with all the module that was create for one thing will be regrouped in the loader to create the main behavior
did you get it? i mean did you understand what i said?
Yeah i got what you mean, but i mean that in Java you have to call the data to 1 entry point whilst in studio you can call you data anywhere in any script
because moduleScript was made to be shared everywhere, like for global variable or global table
i meant hat you dont need a
public static void main(String[] args)
{
}
Yeah that was confusing when i first started scripting
but now you know how to use it right or you are still a bit confused?
Nooo i was never confused it was just weird in the first day or two
This is my first week scripting but i have experience in C, C#, Java, ...
I was only confused about the OOP part if it was used
lua is very easy to learn since is the easiest language x)
if you know C++, it'll be very easy for you
i find lua very lazy
hahah
It was only weird because i am used to singleplayer coding, now i have to combine the server & client part and beaware that hackers can access certain parts
if you want a typecheck like C++
just put this in the first line of your script
--!strict
it will check every type of everything
** You are now Level 3! **
just when you do critical system, do EVERYTHING on server-side and add sanity check on server-side script
only give the neccesry to the client
Yes, do you also spam remote events? or are there better ways to connect server-client
** You are now Level 2! **
Like how i update my gui with server-client i spam remoteevents
function PlayerStatsManager.SetMoney(player, amount)
local stats = PlayerStatsManager.GetPlayer(player)
if not stats then return end
stats.Money = amount
UpdateMoneyEvent:FireClient(player, amount)
end
function PlayerStatsManager.SetRebirths(player, amount)
local stats = PlayerStatsManager.GetPlayer(player)
if not stats then return end
stats.Rebirths = amount
UpdateRebirthsEvent:FireClient(player, amount)
end
function PlayerStatsManager.SetHighscore(player, amount)
local stats = PlayerStatsManager.GetPlayer(player)
if not stats then return end
stats.Highscore = amount
UpdateHighscoreEvent:FireClient(player, amount)
end
Like litteraly i spammed it here.
yeah remoteEvent is the only way to send information to client or server, but i use community lib to protect my remoteEvent, i use type remoteEvent or other lib that secure my script, sometime i encrpyt the data before sending it to the client
remoteEvents is the main target for hacker so be sure to add sanity check
So it isnt really onorthodox how i did it here
Because they are in the replicated storage?
sometime i encrpyt the data before
Damn that is actually insane hahah
I never protected my remote events before i will make sure to do that
ReplicatedStorage is for client and server but serverStorage is for server only (that why you can't get object in serverStorage from localscript)
sorry my wifi got disconnected x)
remoteEvent is literaly a backdoor for any Hacker
if you don't protect it
So i understood there is no-way that a hacker can acces anything server-side, only client-side so ill have to protect everythat that touches client side
Btw if you do PlayerStatsManager:SetHighscore you could use self:GetPlayer()
yes, hacker can ONLY acces to client-side, but they can do server-side thing with remoteEvent so be sure to protect it, i really mean it
Alright so Community lib is recommended by you?
i mean i use it because is useful but you can still use yours
Do you have advice on protecting them? Cuz if im not able to trust the client how could I know for example either where the player is or idk just some other optimal info on client
I mean ill start by doing that sanity check
and making my own first before using a lib
that will make me understand more what the lib will do
add sanity check on server-side
imagine if you are sending player position with remoteEvent, on the server-side you'll check if the position you received is the same on server-side
(it's just a exemple)
but ALWAYS add sanity check on your server-side script
hmm
not sure abt that
that the problem
when the client send me his position
and I verify the position of the client ON the server, well there is latency, because client movement are being replicated to the server, id say a huge latency
so the player position on server is not the same as client
that was just a exemple, i'll do it with a another exemple wait
I see, but sanity checks is like verify the type of something ? like : if type .. == "string" ... ?
function text.new(player)
local self = setmetatable({}, test)
self.Owner = player
RemoteEvent.OnServerEvent:Connect(function(Player))
if self.Owner ~= Player then return end -- Sanity Check
...
end
return self
end
no just add "if" not type, on the exemple i made it's a sanity check
I see
but so in the case you need the client position
how do you do
like his hrp position for example
always get the position from server-side, if it's something critical
or make your system to be use only by the server
I see so that the client can onl be used " Want that information"
the only thing i really don't know how to check is the Camera Position, you can't tell if the position of the camera you send with the remoteEvent is a real position, because on server-side you can't get the camera position, so my idea is to check if the position i got is not too far from the player character
ig then I should probably predict it if i had to get the pos on server side but idk
yes
for example, and its in that kind of situation that makes it hard to counter exploiters
the information you send to the client should be for something soft, not something critical like Attack damage
it depend on the siuation but yeah
yeah always but roblox add security too, recently roblox added "server priority"
idk if it's the right name
what this is doing ? do you have a link?
okay wait
Idk how hacking/exploiting works in roblox, i am fairly new to roblox coding. Why do you need a player's position? Might sound a dumb question, but don't the exploiter have a kind of GUI (never saw an exploiter lol)
so very new information
sorry i can't find it but roblox annouced that on their youtube live
you don't need a gui or anything to hack, i was a exploiter myself
Oh okk, np
exploiter have only acces to client, but they can find backdoor using remoteEvent
you can create your own local scripts and reload them
wait btw
exploiters can load their local scripts faster then the game local scripts?
they use executor that create a fake environement of roblox and send the code through the memory of roblox using C++, like with .dll file
no, there are always a delay before the code got executed (depends on the executor)
ohh kk
I see so they do not have a certain position
but with byfont (the roblox anti-cheat) they get caugh because byfont check if any extern script use "ReadMemory" function on roblox's memory
or any kernel function to get acces to the memory
its kind of facinating how deep exploiters will go for some gems and money
yeah lol x)
** You are now Level 4! **
i have a friend, his hobby is to make cheat on ANY game x)
I means its not hard to use an exploit, however its prob hard to create one
yeah is really hard
but on some game is literaly too easy
just use a kernel function and the game won't even detect x)
CSGO don't even try to make a anti-cheat lol
I mean it is very fun to see how kids are just downloading any exploit from the internet and not expecting any trojan's or malware's
like it is so stupid, you download it from someone that creates them
recently volcano got exposed because it active your camera lol
too bad i dont have a camera 😂
playing game is addictive, you always want more and more, thats why people pay real money for some "gems or money" in a game, and thats also why some kids risks downloading exploits
atleast ig
but ye you right
most exploits prob kills your pc lol
I mean more advanced exploiters will make u botnet slave
** You are now Level 3! **
botnet is not that easy lol
Yes, but i think that would be one of the better ways to use another one's computer.
DDossing can still cause mayor damage
i need help for my portfolio, what can i add? (it's snow particule in the background)
(Pufferfish is my main account)
Tbh there is a reason why i am searching for vector icon's and GUI idea's 😂
nah x)
hmm
i mean
might be a bit of a stretch, but you could make the stars interactivee
for example if you move to the right the backgrounds shifts slightly ass well
Thats cool, do you plan to change the font of the text, or put an outline on particules or idk?
it'll take so much CPU x)
it's just a sketch but yeah, i really need idea for my website
oh okay
Not every indevidual star, that would be too much
but i think you can still make it nice if you integrate a black background and stars on top
and make it shift in a group
like with an animation style it could make it smooth
bro english is so hard, i try to understand what you are saying lol
wait nevermind that idea i gave you
thats good enough
i thought it was a fixed bg
actually the current version is looking like this
it's so empty and i put some bad system 🙁
(is a model 3D and not a gif/video)
i mean the idea isn't bad but its indeed just empty
so that why i'm working on a V2
most people that i know have an empty site because they are very bad in frontend
maybe use figma and just see what yo ucan do
frontend is not my speciality lol
instead of trying to invent, just try it there
i use figma only for logo or minia on youtube x)
When i was creating my own website i also did it in figma
Yeah it is also good for frontend
like really good
it also gives the correct dimentions and if it is absolute etc
recently i lost my USB, inside that USB there we're all my script, C++, lua, python, etc... i lost everything 😭
Exactly why i will never use a USB
I use a drive and in a couple of months i will use a Server
but my pc storage is limited to 50gb, window take too much 😭
i will use my old computer insert proxmox (for VM), and use teamviewer
for remote acces
instead of downloading some sketchy or paid version for remote
You have a trash pc haha
or have downloaded too much
you don't know how much i optimized my pc 💀 , a while ago i optimized too much my pc and i broke my wifi card x)
my pc still freeze on opera GX
Btw if you space out your website like this it would feel less empty
imagine if the text were images
yeah, on the V2 i'll put the text on the center
Like you have the Title on top, maybe a nice looking icon like you have right now and having a info tab under it
Or what you also can do is make it so that the whole square (ex: Mini Map 3D) covers the width of the container and when you hover there comes up and info bar under it with the informatio nyou have
you mean, you want my website to be responsiveness?
** You are now Level 5! **
your website has te be responsive
In the responsive that a even a phone can look at it
those were just idea's it isn't far away from what you have right now, just a width change and a hoverable script
reponsiveness is so hard, i'm still learning
Alright
AYOO i finaly got the level to put message in for-fire channel
@media screen and (min-width: 769px) {
/* STYLES HERE */
}
@media screen and (min-device-width: 481px) and (max-device-width: 768px) {
/* STYLES HERE */
}
@media only screen and (max-device-width: 480px) {
/* STYLES HERE */
}```
Example this is basic responsiveness. When you your device hits a certain width it connects to that query
If you do not have any css in that query nothing of css will show up
BUT with what i mean you dont need responsiveness added. If you make your box container max-width it will automaticly be responsive
to any device
all the logo i made for each system i made
I would refrain from using width: ..px, in the long run you would run into responsive ness issues because your width size never updates
** You are now Level 4! **
oh okay i see
What i said shouldn't be much of a challange. Just make sure you use containers to put your html in
okay, tysm !
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Two-Column Layout</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
display: flex;
height: 100vh;
}
#Leftside-container {
width: 250px;
background-color: #2c3e50;
color: white;
padding: 20px;
box-sizing: border-box;
}
#middlescreen-container {
flex: 1;
background-color: #ecf0f1;
padding: 20px;
box-sizing: border-box;
}
h2 {
margin-top: 0;
}
</style>
</head>
<body>
<div id="Leftside-container">
<h2>Left Side</h2>
<p>Navigation or sidebar content goes here.</p>
</div>
<div id="middlescreen-container">
<h2>Middle Screen</h2>
<p>Main content goes here.</p>
</div>
</body>
</html>
Example here is that you create containers and 1 container has indeed a width. But container "middlescreen-container" has flex 1 which means that he will take the remaining space. For to make it responsive you will juse have to update the html<div id="Leftside-container"> pixel width.
ohh okay, i understand now
You can add a box
.box {
background-color: white;
padding: 20px;
flex: 1 1 200px;
box-sizing: border-box;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}```
where the flex would show width grows, minimum 200px
i know i am over explaining a bit
what is only screen ?
that it targers moniters, phones, tables everything with a screen
oh okay
You can all so use " @media all { ... } -> hits up all devices", "@media print { ... } -> only when a page is in print view"
but i never used those
i only have used screen
since i'm suing tailwindCSS, i just have to do ?
@media screen and ... {
-- width: ...
-- height: ...
}
Btw Flex-box is a super nice way to learn to css
https://www.w3schools.com/css/css3_flexbox.asp
Use this to learn flex. It is prob the most easiest way to make things automaticly response
I am not a Front-end expert but i have made some sites for school
I never used tailwind or anything, always had to use the basic, i didn't even knew there were specific css types lol
thanks you
You can also use Grid boxes
lol, tailwindCSS is so much more easy and i'm using NextJS so i can put global CSS for any pages i want
everything i learned is on that site just scroll a bit and you will find examples
We had to use float for my first project that was a disaster
never use that lol
so useless
what is float ?
flexbox is so much easier
ohh floatt x)
it is also used for positioning and formatting
but it is like a bit of a stertch for certain things
you will eventually run into problems with positioning something
it might be usefull for having boxes next-to each other
like a list
but that is it i think
i have a friend, he's very good at everything, so he can help me making my website
i mostly use AI
that is my best friend
I would not recommend it for beginners in a certain coding language
but if you understand what you are doing i dont have a problem with using it tbh
i restraint myself from using AI x) i want to learn by myself even if it take much longer
i cannot restrain my self, i am so addicted to AI
i was but now i stopped (still a little bit) using it :)
i swtiched mayor's now i will try to refrain my self from using it
especially with c or scriping in linux
you are using C for what?
ehh fundamentals, prob later we will use arduino ig
ohh cool, i want to do the same but don't have any money to buy chip :(
I have created a whole game with arduino i wanted to end it right there
so i use C++ for creating cheat for fun
it cost like 12 eur
or sum
nvm
30
De Arduino Uno is het beste board om met elektronica en coderen te beginnen. Als dit je eerste ervaring is met het experimenteren met het platform, is de UNO het meest robuuste board waarmee je kunt beginnen experimenteren. De Uno is het meest gebruikte en best gedocumenteerde board van de hele Ardu
i have money but it's just i don't have any coms, it's been one week i don't get any com now, it make me less motivated but i keep going, i keep trying
but you still need to buy a display etc
it is not easy
That is something i can tel lyou because you directly talk with the memory
call the registers etc
oh cool
i didnt have any fun with that
lol
like i had sleepless nights because i couldn't figure out the frequency of a sound
or that it didn't wanted to save my action for some reason
arduirno is really hard?
** You are now Level 5! **
but we just had to create a game with it and that was my only goal to finish that task
i think i'll stay on C++ it's better
yeah but with C you can do more indept
For optimizing it is better to go to C, because you can directly acces the registry etc
on arduino
people said C++ is the same as C but with typecheking
C++ is literaly the same as C but with typechecking and OOP
Yeah the OOP is a big problem in C
but C is used to create lib for C++
you have to use with Header files like in roblox studio
headfiles -> Module files
ig you can see them both as the same they both do nothing untill called for
yeah this is annoying
And with C you have a very minimal lib
that why C++ is better :)
But in C you can use Malloc and calloc, you can still use them in c++ but they arent recommended
i just read that
300 message x)
ew ur french
lol
napoleon did some damage
belgium refused chat control right?
no clue
i think so
i read that
i was so flabberghasted
that they were allowing that
imagine my sentence would be, the amound of swat's i would have per day
if a hacker found a backdoor, they'll see EVERY message and that mean, secret message between hight grade people
yeah that is true
Btw if you are intereseted about malloc and calloc:
Malloc is just a function that gives you a block of memoryu where you can store information. It might already contain information
Whist colloc: clears that block of information
I am now mayoring in security and systems, so that would be a problem for me 😂
ohhh okay
lol x)
i'll go back scripting my tank system
Goodluck is it like a war tank or what sort of a tank😂😂
the model are made by a friend and the system i'll sell it for 30-50k robux
lol, that why you should learn to use markdown
Before i came into the server i thouhjt i was ready to take on servers😂😂
Projects*
before doing a system, you must already have a list in your head to know what you'll do
look, i'm using OOP for my tank system too :) (i'm just starting the script)
Brodie readss that first line and wants a refubd😂😂😂😭
Yeah i see i am now creating a whole game where sphere are shooting out of a cylynder and you have to dodge it.
that all the parameter you can change on any tank
just moving each model or using tweenService
yeah, i just need to put a global structure for every tank, so my system work with every tank and recognize every model and what they should do
** You are now Level 6! **
Yeah that is why i learned my friend software engeneering
It is so much easier if you have your code structured well
Does roblox also work with outside servers for Databases?
yeah, you can do request/POST/GET with httpsservice
Please get php out of my head
yeah is not very secure
Nrver want to experience that again
but httpsservice can be very good, like using webhook, a while ago i made a lib to create a fully discord bot but coding with luau instead of javascript
took me alots of time
You prob want to create your own encryptor
Damn
Thats insane
I am dedicated enough to code my game but not dedicated enough to build or gfx it
yeah that the main issue for every solo creator
That is why i am searching for jobs to generate some robux
it's been one week i can't even find someone... it so demotivating
I am prob going to join some discord servers and ask if they need scripters
Like players with 3-4k daily
But idk if tvey will accept me with my limited roblox studio knowledge, but maybe they can pardon it with my knowledge overall
you'll find out that being a roblox scipter is not that easy, you'll see people asking for system for only like 1K then the real price should be more than 10k
just a exemple, people think complexe combat system is only 5K but it's more than 15k, maybe i can be the wrong one, but since you are new, try to reach coms for review even it's not too worthy for you
I mean its worth a try, it is very difficult for me to know what the mroce ranges are
and people scam alots, so there are multiple payement methode
50% at the start and 50% at the end
after completation
per-task
etc...
and be sure you do everyting in your OWN place
Yeaj but i meant more like how much would that type of work be done. Like they could be offering 5k but it could be worth 10k
when you get a coms, do a markdown that will list every thing you'll do, if is easy then a bit of robux but if is complexe then the price will raise
but be sure when it's a big coms or complexe system, be sure to be more than 10K, and try if you can be paid per hour, the hour you put to finish the system will be the number of robux you get
do you understand?
Yes i understand thanns
I think when i finish this game ill apply
I have allot to do yet
and be sure you have a portfolio or just image of past work you have
Would you rzcommend posting your works to gitjub?
I mean why not ig
Thank you for all the help btw
np 🔥
use OOP for systems that should be re-usable and have lots of use cases.