Source:
local Animal = {
voice = "", name = ""
}
print("What's animal we should to program?")
answer = io.read()
print("What's noices that your animal says?")
answer_2 = io.read()
Animal.voice = answer_2
Animal.name = answer
print("Object created, do you want to use 'Voice!' command?")
command_check = io.read()
if command_check == "yes" then
print(Animal.voice)
end
print("Your animal: name:", Animal.name, "voice:", Animal.voice)
On this page of the site you can watch the video online Lua: Simple OOP example with a duration of hours minute second in good quality, which was uploaded by the user Quantum 01 September 2022, share the link with friends and acquaintances, this video has already been watched 77 times on youtube and it was liked by 0 viewers. Enjoy your viewing!