FindFirstChild() If you call a part lets say, gravity, theres also the a property in the workspace callled gravity so you us :FindFirstChild() So, game.Workspace.FindFirstChild("Gravity") What :FindFirstChild does is only look for only the things inside workspace A child is something inside of another thing, so, most parts are INSIDE the workspace. Or there are scripts INSIDE the SereverScriptService What happens if there are two parts called the same thing? Well you can't have two parts called the same thing, they must be named something different like Part1 and Part2 Spelling mistakes can be a really common thing that makes an error in your script, make sure to always look over your script when an error occurs for any spelling mistakes Vector3 Size is made up of 3 values called a Vector3 value, in a script this would look like, Vector3.new(X,Y,Z) Wait() To pause a script you must use, Wait(), which allows you to delay your script from excuting the next line of code Comments Comments are used as a bit of text that the script ignores, to use a comment you must put two hyphens before your text, like this, -- Text After Gravity Gravity is a force that pushes down on objects that are in the game The higher the gravity the stronger the force is, the lower the gravity the less the force is A group or model is a collection of different objects together Variables Variables are used to hold a bit of information, lets say, game.Workspace.Part Insted of writing that out every time you would start with local Part = game.Workspace.Part (You can do it whithout local, but, its could practice to do it whith local) A variable can be any of the four data types (Data types below) You have to define a variable before you use it, like, You can, local Text = "HELLO" print(Text) But you cant, print(Text) local Text = "HELLO As you can see defining the variable comes first before you use it Data Types The four data types are, "" - Text 3012 - Number true / false - Boolean game.WorkSpace.Part - Object Refrence Instance Instance means an object in Roblox Lets say you want to insert an object at a certian time you say, Instance.new() Inside the brackets you put in the name of the object you want to insert, so, Instance.new("Part") To put where you want the part to go you must define all the properties first, then, Part.Parent = game.Workspace or, Part.Parent = game.ServerScriptService etc To change the size, colour, etc you must make it a variable, so, local Part = Instance.new("Part") So now we have made it a variable we can now change the properties of the part, so, Part.Transparency = 0.6 We can also change its position, so, Part.Position = Vector3.new(X,Y,Z) Function Functions are a defined bit of code which will run when we call it by a name to create a function you start with, fuction (any name, i will put,) generatePart() (Code within this, so,) local part = instance.new("Part") -- This generates a new part part.Transparency = 1 part.position = vector3.new(8,16,90) end When i call the function, so, generatePart() It will run the code which is inside the function above, so, local part = instance.new("Part") part.Transparency = 1 part.position = vector3.new(8,16,90) This peice of code will run when we call, generatePart() You have to define a function before you run the code so you couldnt do this, generatePart() fuction generatePart() -- Called the function before you defined down below local part = instance.new("Part") part.Transparency = 1 part.position = vector3.new(8,16,90) end You can do what is above at the start (Defining function first, then calling function) When we call a function the properties will be the exact same every single time unless, you tell the script you want to, lets say, change the transparency to 0.5 instead of 1 every time, to do this you must use something called parameters/arguments The parameter is a bit of data we will send over, we will send it when we call the function, so like sending a bit of data saying you want the part to have a transparency of 0.5 instead of 1 First you need to tell your function what data it will expect, the function cant just be sent data with out knowing what it is, to do this you, fuction generatePart(name) -- You add the data it will expect between these two brackets local part = instance.new("Part") part.Name = "HELLO" part.Transparency = 1 part.position = vector3.new(8,16,90) end then you send the data to the function, when you call the function data will be sent if you do this, generatePart("Part1") -- The data which will be sent will be between these two brackets and when sent it will chnage the parts name you just made to "Part1" as you told it to We are not done yet, instead of saying the part name is equal to, part.Name = "HELLO" We say part is equal to, part.Name = name You can do this with any property, so, BrickColor, Transparency, etc Parameters are basically variables inside a function (Parameters are the first brackets, so) fuction generatePart(name) - Parameters (CODE HERE) end The peice of data when you call the function are arguments, so, generatePart("Part1") -- Peice of data in here is called arguments You can do multiple parameters but make sure they are in order Returning allows you to send back data to a function to be used later on In this example there are two numbers being added togehter function addNumbers(number1 + number2) local NumbersResult = number1 + number2 end addNumbers(3,9) -- 12 To return something you use the word return which will stop the function and it sends some information back to where we called it from. Like this, function addNumbers(number1 + number2) local NumbersResult = number1 + number2 return result end local calculationResult = addNumbers(Number1 = Number2) -- We must make it a variable so it can hold information Another example of this is, function createPart(transparency, anchored) local Part = instance.new("Part") Part.transparency = Transparency return Part end local CreatedPart = createPart(0.5, true) What ever get returned is now equal to CreatedPart We can now say, CreatedPart(0.7, false) Which means we have access to its properties (we can only change the the properties in the the parameters, that have been set, so, transparency and anchored Some functions are pre-defined The ones we will be focusing on is, Destroy() Clone() ClearAllChildren() Wait() Print() The first three which specifiaclly do something to a certian part, unlike the last to which can be called at any time which doesnt do something to a specific part To use the first three we do, game.Workspace.Part:Destory() or, game.Workspace.Part:Clone() -- If you clone this, the script doesnt know where to put the clone, so we make it into a variable Like this, local Part = game.Workspace.Part:Clone() -- Making it into a variable Part.Parent = game.Workspace -- Setting its parent, so where its going to go, in this case its the workspace, but because its a clone of the the same part, it will be in the same place so we set its position Like this, Part.Position = Vector3.new(X,Y,Z) -- For the X,Y,Z you must put in your own coordinates so, lets say, 3,4,7 or, game.Workspace.Part:ClearAllChildren() -- When you call it on an object, it clears all the things inside that part, so lets say there was a script inside your part, it would be cleared or destoryed (Which is the same thing) These are now to the global functions Wait() -- Which makes the script wait for a certian pariod of time (What ever number you put in the brackets), which means no code will be excuted while that wait is happening Print() -- This lets you print a message in the output window, we can use printing to find errors in code Events Events wait for something to happen, then does it An example of this is an alarm clock which is at 6.59 am, the event constantly checks intul its 7 am so it won go off yet but, the scipt is constantly checking for when its going to be 7 am, when it is 7 am it perfroms an action, so in this case, an alarm In roblox studio, when you select an object there are, pink icons, which are built in functions, the blue icons are properties and the yellow icons are the events An example of one of the events, the, touched event is, function PartTouched() -- defining function to use in the event print("THE PART HAS BEEN TOUCHED") -- This is what will be printed when the part has been touched end game.Workspace.Part(Getting the object we want to use).Touched(Listen out for when the part has been touched):Connect(This is telling the script that when the event happens, we need to run some code) (PartTouched) (In this we specify the function want to trigger when the event happens, so in this case, when the player touches the part, the event will be triggered, which tells the function to do something) You must define the function before you make the event Another way of doing this is defining the function in the same peice of code as the event is in To do this, we, game.Workspace.Part(Refrence part).Touched(Listens for when the the part has been touched):Connect(Telling the script we need to run some code) (function() print("THE PART HAS BEEN TOUCHED") end) How do we know what has touched the part? game.Workspace.Part.Touched:Connect(function(hit) -- The brackets after the -- We are sending data back to the function, function can be called anything the data will be sent to hit, which will trigger the funtion, which in this case is print(hit.name) print(hit.Name) -- This will print the part that touched our main part end) Lets say we want to make the player slip when they touch the part, to this we must, game.Workspace.Part.Touched:Connect(function(hit) hit.parent(Hit is the part that touched the main part, so if it was a player it would be its leg and its parent is the model which the leg is inside).Humanoid(The humanoid is inside the model of the player).Sit = true end) But lets say it isnt a part with a humanoid, we must do an if statement, to do this we do, game.Workspace.Part.Touched:Connect(function(hit) if game.players:GetPlayerFromCharacter(hit.parent) then hit.parent.Humanoid.Sit = true end end)