of     1   

IGamerZeroI
#227615941Thursday, November 16, 2017 10:14 PM GMT

I'm trying to convert my current knowledge form JS and Python Into Lua and it's hard, I have a few questions. PLEASE try to answer one for me if you can't answer all of them. 1. How do you make a object or array in Lua? 2. Whats the boolean? Ex: || && ! 3. How does the local and global variables work? Can a local variable made in something like a function be used outside the function but not outside the script? 4. Is a object orientated structure possible? 5. Is there a way I can change the text size inside the script? It's really annoying me.
Cyrakohl
#227616125Thursday, November 16, 2017 10:20 PM GMT

I cannot answer all your questions but i can answer these: 1. Arrays are formed as this: Array = { [Index] = [Value] } 2. A boolean has two values(True,False) Sort of like saying True is Yes and no is false. 3. Global variables are globally scoped so they can be used anywhere sort of the same with local if i am correct.
Proxinable
#227616203Thursday, November 16, 2017 10:22 PM GMT

## local part = Instance.new("Part", game.Workspace) local array = ### ## ## ## ### ### ## Not exactly sure what you mean. Lua uses "or", "and" and "not" keywords. "==" > compare variables, "=" > assign values, "~=" > does not equal, ">=" "" greater than and smaller than, the first 2 are including the value itself. 3) A local variable can not be used outside of the function. 4) To an extent, others are probably able to explain this better. 5) No idea, it's the perfect size for me.
Cyrakohl
#227616243Thursday, November 16, 2017 10:23 PM GMT

4. This is possible due to mertatables: http://wiki.roblox.com/index.php?title=Object-Oriented_Programming 5. You can zoom in with mouse scroll (Sorry it was seperated)
Proxinable
#227616245Thursday, November 16, 2017 10:23 PM GMT

Nvm then.
IGamerZeroI
#227616290Thursday, November 16, 2017 10:24 PM GMT

Thanks! Its odd '&&' is called 'and' though. Maybe its just me. I'll keep looking to see if Lua has object oriented. But thanks a-lot both of you.
IGamerZeroI
#227616328Thursday, November 16, 2017 10:25 PM GMT

Ah mouse scroll is text size XD
INOOBE_YT
#227616345Thursday, November 16, 2017 10:26 PM GMT

The operators are and, or, ~=, =, ==
IGamerZeroI
#227616388Thursday, November 16, 2017 10:27 PM GMT

Wait, wait, wait what is ~=? Is the not equal to? or not strictly equal?
Cyrakohl
#227616406Thursday, November 16, 2017 10:28 PM GMT

is Not equal to
Proxinable
#227616411Thursday, November 16, 2017 10:28 PM GMT

~= is not equal to
Nikkulai
#227616476Thursday, November 16, 2017 10:30 PM GMT

It is basically not equal oto For examples: ### # # ###### Statement ### ## # ###### Statement 6-2 = 8 --False Statement Its basically used just to check if something is not true.
GodShowsTheWay
#227616575Thursday, November 16, 2017 10:34 PM GMT

search learnxinyminutes and look up Lua it should provide the basic knowledge that you need to start out in lua. read the everything up until the end of modules because everything beyond that pretty much is not relevant to roblox lua
memorycode
#227616705Thursday, November 16, 2017 10:38 PM GMT

3. local variables are available only inside of the scope they are created variable = true local localVariable = false local otherVariable = 1 function thing() local localVariable = "nope" otherVariable = 2 print(localVariable) ---> nope local aSpecialVariable = "cant access me" diffVar = true end thing() print(localVariable) ---> false print(otherVariable) ---> 2 print(aSpecialVariable) ---> nil print(diffVar) ---> true 4. yes, absolutely. there are examples on the lua website and on the roblox wiki 5. yes, file -> settings -> studio -> scroll down to script editor
Luo_Basics
#227616907Thursday, November 16, 2017 10:43 PM GMT

1. Instance.new("InstanceType") 2. true, false. to answer your question it's or, and, not. do not touch the "not" to the boolean, i.e. not true is correct. if (a || b && !c) { console.log("hello") } if a or b and not c then io.write("hello") --you will have to use print with roblox. end local variables go like local function hello() local variable = true end the script can't access "variable" because it is outside of the scope. oop is possible yes ctrl and + twice or ctrl + scroll wheel if (dev.ShouldLearnNewLanguage){dev:LearnJS()}
szkiller_dev
#227616944Thursday, November 16, 2017 10:45 PM GMT

... wiki.roblox.com Lua is my moon, Java is my coffee, Pascal is my dad, C++ is my grade, Ruby is my jewelry, php is my site 😎😎
KapKing47
#227619132Thursday, November 16, 2017 11:56 PM GMT

1. local array = {} or local object = Instance.new('ObjectName'). 2. and, or, not, >=, <=, ==. 3. Local variables cannot be used outside the scope that they are declared in. To share a variable across scripts (Only server-server and client-client though) u can use _G.VariableName = Value. 4. Metatables I guess. 5. In Studio settings I think. Or just zoom in by ctrl+mouse scroll.
KapKing47
#227619167Thursday, November 16, 2017 11:57 PM GMT

2. Whoops, forgot to add ~=.
TaaRt
#227619337Friday, November 17, 2017 12:02 AM GMT

4. Is a object orientated structure possible? As far as I am aware, it never gets truly object-oriented under the hood; you can edit the Lua source files, using xml objects the way ROBLOX does. In behavior metatables can be used to recreate classes in almost any aspect, but deep down they're not the same as a virtual function table which is what I believe defines a language as OO (but if I'm wrong please do tell)
LaeMVP
#227619665Friday, November 17, 2017 12:12 AM GMT

[1] = by object did you mean userdata? if so you could make your own using metatables and nexproxy [2] = or, and, not [3] = scope [4] = *yes* [5] = go into settings and change it

    of     1