-
Notifications
You must be signed in to change notification settings - Fork 36
/
luau.luau
87 lines (69 loc) · 1.18 KB
/
luau.luau
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
--[[
big comment
]]
local atomTest = true
local atomTestWithType: boolean = true
local atomTestWithTyper: true | false = true -- comments
local positiveTest = true
local negativeTest = false
local stringTest = "string"
local stringTestWithType: string = "string"
local coolNumber = 1
coolNumber *= 2
--[[
tablas
]]
--
local coolTable = {
wow = {
{
a = 2,
f = {
five = "5",
},
},
},
}
for i, v in ipairs(coolTable) do
print(i, v)
end
for i: number, v in ipairs(coolTable) do
print(i, v)
end
print(#coolTable)
if true then
print("cool")
end
if #coolTable.wow == 1 then
print("cooler")
else
print("not cooler")
end
if #coolTable.wow ~= 1 then
print("cooler 2")
else
print("not cooler 2")
end
if #coolTable.wow >= 1 then
print("cooler 3")
else
print("not cooler 3")
end
--=> Test
do
local module = {}
function module:getHello(): string
return "hello from module!"
end
function module:hello(): string
return self:getHello()
end
print(module:hello())
end
--=> Type Testing
export type Test = {}
export type TestType = Test & {}
--=> backtick
print(`Hello, {coolTable.wow[1].a}!`)
--=> Roblox Services
local RunService = game:GetService("RunService")