of     1   

Atlant123
#228352355Saturday, December 02, 2017 11:31 PM GMT

Would be great if anyone could help! So im confused on ipairs,pairs,functions,parameters,arguments,etc. For an example I insert a script into a part thats in the workspace. So i do Anything = script.Parent Anything.Touched:connect(function() - The Question Is, What do i do after that function? Lets get a bit more advanced. Function OnTouch( ) <—####s this where i put my event/etc? A bit confused to the basics Lets move ahead to parameters and arguments. X = 3 - 3 Print(“X”) - The question here is, Wheres the argument and parameter? What do they define? Next, Ipairs and pairs. I truly think this is the most complex to me. All i know is i,v in pairs. I need a fully brief explantion on it please. In addition, whats the difference between the two? Lastly, the additonal part comes in, what does the term “return” do? Definition? How about “else”? Why are symbols like “..” used in scripts and [] {}? Why cant it just be basic parentheses? I give up haha. I would be truly thankful if anyone explained all this to me and maybe even teach more. I plan to become a dev! And no im not wasting your time for just a regular lesson of the day, im using your answers daily! Please notice this if you can! Thank you! And oh yeah! Please make it as simple as possible. I can see there is many vocabulary words used when people explain scripting. If you have to, go ahead.
Luo_Basics
#228352502Saturday, December 02, 2017 11:34 PM GMT

Anything = script.Parent Anything.Touched:Connect(function() end) or local function TouchFunction() end Anthing.Touched:Connect(TouchFunction) .. is to concat stuff so local string = "hello".." world" would turn into 1 string ipairs vs pairs is simple, ipairs stops if something in the table is nil. local a = {"hello", nil, 4} for i,v in ipairs(a) do print(v) end --"hello" for i,v in pairs(a) do print(v) end --"hello", 4 for i,v in next, a do print(v) end --"hello", 4
Luo_Basics
#228352544Saturday, December 02, 2017 11:35 PM GMT

On your variable example, you're doing it wrong. X = 3 - 3 Print(“X”) You enclosed X in "", so it's just a string, therefore printing "X" If you wanted to print the actual variable, X it would just be print(X)

    of     1