Robloxscripts
Making scripts: How and where to get started. - Printable Version

+- Robloxscripts (https://forum.robloxscripts.com)
+-- Forum: Roblox (https://forum.robloxscripts.com/forumdisplay.php?fid=5)
+--- Forum: Scripting Guides & Help (https://forum.robloxscripts.com/forumdisplay.php?fid=7)
+--- Thread: Making scripts: How and where to get started. (/showthread.php?tid=283)

Pages: 1 2 3 4


Making scripts: How and where to get started. - stitch - 12-19-2020

1. Tools

An executor, this is used to execute your scripts into Roblox. I highly recommend getting Synapse X (there are no such things as Synapse X cracks, so don't get fooled by that!).

A remote spy, I'll be using FrostHook.

An explorer, if you have SynX, you should have dark dex in the script hub.

2. Basics

2.1 Printing.

Lets start with testing your exploit, go into a game, attach your exploit (usually done by pressing a button which says something like attach or inject)

Now when that's done, try executing this:
You must click thanks to see this content...
Now press F9 on your keyboard to open the developer console, you should see white text saying "Hello!". If it didn't, make sure everything is properly set-up.

Printing can be used to indicate something has happened, for example if your autofarm killed it a target, it could print that the target has been killed (more on if-statements later)

2.2 Variables.

Variables are basically things that make your life easier, for example:
You must click thanks to see this content...
Hello is written like "Hello", because it has to be a string (a string is basically text)

Variables can also be paths:
You must click thanks to see this content...
this will print the color of your head

If you would want to print a number, for example:
You must click thanks to see this content...
You would have to use tostring() to make it a string.

2.3 Tables.

Tables are multiple things in one variable, for example a number and a string:
You must click thanks to see this content...
To get information out of a table, we have to use Table[], for example:
You must click thanks to see this content...
This prints the 1st thing in the table, indicated by Table[1], which is "Hello".

Click here for more information on tables.

2.4 For Loops.

A for loop is used to loop something a set amount of times, for example:
You must click thanks to see this content...
this is the most basic of for loops, it will print i (the amount of times the loop has currently looped) 5 times, i can be named anything.

A for loop can also be used to print the contents of a table, which is done like so:
You must click thanks to see this content...
v is the object the loop is currently at, so if i = 2, v should be "String2"

A path in roblox can also be made into a table, which means this can be used in a for loop:
[Image: 49a1625054f959d5538297e2c413eadc.png]
You must click thanks to see this content...

I did a lot here, but don't worry ill explain it all.

GetChildren() gets all the things in an object, so if we want to get all the children on game.Workspace.Enemies, we use GetChildren(). There's also GetDescendants(), which get all the children, and the children of that etc

Name is a property of the object (aka v in this case)

You can also see a lot of dots, which is used to make multiple strings into one string. so we could do
You must click thanks to see this content...
and it would print "Hello World!", make sure to add a space if you don't want it to be one word.

2.5 While Loop.

You must click thanks to see this content...
wait() is a cooldown in seconds you can add anywhere in your script

you can do also something like this:
You must click thanks to see this content...
it will keep looping until variable is false.

2.6 RenderStepped.

This loop depends on your FPS (frames per second), so if you were to have 60 FPS, it would loop 60 times a second

You must click thanks to see this content...
For more information about RenderStepped click here

2.7 if, elseif and else.

If statements are useful for multiple things, like checking if something exists, checking if a certain condition is met and a lot more

You must click thanks to see this content...
We used a for loop to get all things in Enemies, then use if v:IsA("Part") then which translated to english means: if v is a part then it should continue.

if you want to check something like the name of an object:
You must click thanks to see this content...
You can see I used and, which can be used to make sure multiple conditions are met to continue
Make sure to use 2 ='s 

If you wanna check for multiple things, you can use elseif and else:

You must click thanks to see this content...
Click here for more information about if statements.

2.8 Remotes
This was explained in depth by Froggo on v3rm, so I'll leave it up to him.
PART 1
PART 2
PART 3

2.9. Functions
functions are really easy to learn and can optimize your script a lot. 

You must click thanks to see this content...
make a new function by typing function then the function name with () at the end
the script above should print "Hi!" because the argument used for the function (test) is "Hi!", and it prints the argument.

click here for more information about functions.

3. GUI's.

If you have a lot of scripts for a game, you obviously want a gui so it can be easy to use.

Start by opening up a new baseplate in roblox studio

Then create a ScreenGui in StarterGui.
[Image: 84a2b64efa7d8172568e5ebf758d2ec3.png]

In the ScreenGui (I recommend naming it something else) add a Frame, which will be our main part of the gui.
[Image: 6aa4f61c43a08cd7562bb3f5f340a4fd.png]
You can change the frame as much as you like (size, color etc)
I also recommend changing the frame's name to something like Main

Then create a TextButton in the Frame, customize that to your likings as well.
[Image: 3b774fe39d42b5f1fb056afbfcdb27c1.png]

Thats it for my simple gui, were now gonna convert it to script, to do that, install this plugin. Then do the following
[Image: 9ae3fe4f7d81c05b31925a22e19696a1.gif]

Make sure you have the ScreenGui selected when clicking convert.

Now we have a big script which should be called gui2lua#1
Open the script and go to the bottom, were gonna bind a function to our button now.

You must click thanks to see this content...
toggle is our variable for checking if its on or off, 
make sure that you are using the correct TextButton, you can see your buttons at the top of the gui2lua script (under --instances)
toggle = not toggle means toggle is gonna be the opposite of what it was, in this case the opposite of false is true, so it sets toggle to true
then we use an if statement to check if toggle is true
then we use a repeat loop until toggle is false

4. Making a simple simulator GUI.
4.1 Finding a game.

this is usually the easiest part, every month at least 1 new semi-popular simulator drops.

If you have a simulator in mind, you can skip this.

What I always do is just searching "simulator" in roblox and you'll find a lot, you wanna look for a game with around 100-1000 players, anything above probably already has scripts made for it(would defo check, in case there isn't any or only bad ones!)

4.2 Checking out the game.

before making a script, you have to know what the purpose is, are there any remotes to fulfill the purpose, does it have an anticheat etc.

I'll be using Minion Simulator as an example game.

What I like to do first is executing frosthook and checking the remotes.

The purpose of the game is using your minions to mine gold bars, there happens to be a remote for that

You must click thanks to see this content...
The PartName can be found by going to workspace>Storage>Clickables>the zone(Valley in this case)

then theres a bunch of parts with random numbers, theres are all the bricks.

PetId is the minion your using (probably)

UpdateType is what the minion is gonna do, StartMoving means its going to brick (im guessing). Theres also StartMining which we can probably use later.

So if we execute the remote (with StartMining not StartMoving), we cant see the minion doing anything, but it will actually start mining.

Now we are gonna use a for loop to get all the bricks that our minion is gonna mine:

You must click thanks to see this content...
we used 2 if statements to check if what we want is actually what we want, so basically a double check.

then it's gonna mine all the bricks in the game

we can now make the script a lot smaller like so:

You must click thanks to see this content...

Now let's make another one on a different type of simulator

I'll be using Banana Simulator 2

The purpose of this game is eating bananas for coins

The remote for eating bananas is:
You must click thanks to see this content...
string_2 is the banana we are eating

now we can use a simple while loop to loop it
You must click thanks to see this content...
renderstepped isn't needed here because there's a debounce on the remote (cooldown). I also recommend using a short wait because after some time your game can start lagging and sometimes even crash.

I also made the script shorter.

I also noticed there are banana's on the ground which can be picked up, they also give cash which we can use to our advantage

The banana pickups are located at workspace.FruitDrops

You must click thanks to see this content...
So I used if v:IsA("NumberValue") then because if I were to check for a mesh it wouldn't work because there's multiple meshes that arent bananas, and only bananas have a NumberValue object in them

You could also collide with bananas, so I did CanCollide = false

I also noticed there was a BoolValue in the bananas called CanGet, which I'm not sure what it does so I just set it to true.

You can also make something like auto egg openings or something, which is usually done by a remote.

If you wanna make a teleport script, you can set your CFrame to the location you wanna go like so:

You must click thanks to see this content...

you can only set your CFrame to another CFrame!

That's most you need to know about making a simple simulator script, if I missed anything please reply! If you need help you can always add me on discord and I'll gladly help! stitch the elite#9709

5. Advanced (Coming soon)
1. require
2. metatables
3. upvalues
4. ui-library's
5. +more



Sometimes my english is a bit broken sorry about that 

please leave a thank since this took a lot of time to make


RE: Making scripts: How and where to get started - Invell - 12-19-2020

This is a really well made and easy to understand thread, I am looking forward to see the fruit of your efforts in creating this for aspiring scripters and developers !


RE: Making scripts: How and where to get started - PepePIG - 12-20-2020

nice explanation newbie scripter will understand this so easily


RE: Making scripts: How and where to get started - JohnCummings - 12-20-2020

sexyy


RE: Making scripts: How and where to get started - Ap3xture - 12-20-2020

rule no 69 there is no shame to revise the basics


RE: Making scripts: How and where to get started - Kay - 12-20-2020

WOW amazing job! this will help alot of soon-to-be script makers (like myself) get on the right foot! Thank you!


RE: Making scripts: How and where to get started - N0JU3#1216 - 12-20-2020

thanks man ill try it later on when i have time!


RE: Making scripts: How and where to get started. - helo - 12-23-2020

This was so helpful thanks.


RE: Making scripts: How and where to get started. - Real Panda - 12-24-2020

Nice but you're randomly switching between global and local variables without explaining the difference between them, which might confuse beginners


RE: Making scripts: How and where to get started. - French Spy - 12-27-2020

Well made, thank you for taking some of your time to do this