Lua Tutorial #3: Variables and User Input

preview_player
Показать описание
We learn about variables and getting input from the user.
Рекомендации по теме
Комментарии
Автор

Can I just say, I have been playing around trying to grasp lua for ages, and with me being heavily focused around Garry's mod lua, I am starting to see what things mean, and for that I was to say thank you I am understanding it properly for the first time.

lightsoundstudios
Автор

I've been trying to grasp Lua and it's been a big headache, but after watching these videos, I'm finally figuring it out. This is clear, easy to understand, and easy to follow of what things do and how to put them into a code correctly. I'm really glad for these videos, or I would still have no idea of what I'm doing.

RobThefox
Автор

Nice tutorial much better than your old lua tutorials hopefully these will last longer than 11 videos

gamenerd
Автор

I like how you explain things. It's very easy to follow. Thanks for making these videos.

Pikmeir
Автор

This is simplly awsome! It is helping me personally a lot! Thank you and please don't stop making these :D

LunaLoveWoW
Автор

unbelievably helpful I've been looking around YouTube for days now looking for a decent guide to Lua my guy you've earned my sub keep makin awesome sht

i_inject_crayons
Автор

That's coming in a future video -- if you want to know about it right now, the text tutorial for "If Statements" can be navigated to from the link in this video's description.

DevHQLessons
Автор

Hey, whenever I try to start a program using io.write to print words, it just comes up blank in the Lua Executor I downloaded. When I try to input it on another program, Zerobrane Studio, it comes up with "file (0x757b2920)".  I also wrote down the script exactly at 8:33 I get an error that says [string "io.write("Enter your name: ")..."]:3: attempt to concatenate global 'user_input' (a nil value)

XRozelX
Автор

Great help, I'm trying to make games with lua and this helps a lot.

ymottzter
Автор

for anyone having a problem with the print not outputting before getting user input and is using an jetbrains ide with a lua plugin (pycharm, intellij, etc), you need to add "-e io.stdout:setvbuf('no')" to your interpreter options

Axxhelairon
Автор

Thanks for the reply, can't wait for the next video.

bob
Автор

Are you planning on continuing this tutorial anytime soon?

bob
Автор

how do you stop the file from closing right away? for example, in batch you just write "pause" and it puts out the "press any button to continue..." line or "pause>nul" which does the same thing but no text

HeroOfTime
Автор

Is it possible with the if statement to check multiple things, like for example if I said that something was the number 3, is it possible with one if statement to check if it's 1, 2 or 3? Or do you need multiple if statements?

ZeDerpazoid
Автор

I am having an issue where if you change the name it shows the previous inputs.
EX:
io.write("First Name:")
>Jeffret [change to] Jeffrey
First_Name = io.read()
print(First_Name)
>Jeffrety

I was wondering if there is a way of getting the true "final" output of a name.

JeffreyAldrichSyntheticWolf
Автор

can a program detect what characters it's reading? like for a programming language?

BILLPC
Автор

i am making some lua and have a question about while loops

i've tried while i == ("do" or 5 or "hi" ) do and then something, but it only counts the first, in this example "do". what do i do?

Skaeji
Автор

Does this work in CODEA for iPad ? I am beginning to learn Lua I know java and C++ but I'm not sure if I should buy CODEA because I don't know if it will work with Lua

emmanuellopez
Автор

I have your code typed out in notepad++ 
io.write("enter your name: ")
user_input = io.read ()
Print("Hello, " .. user_input .. "!")
it pulls up and lets me type in my name but it closes right after and it won't let me see the result. Please help

TheGamingExperience
Автор

lua wont stay open it just closes can someone tell me what to do?

TheGamingExperience