wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Roblox Lanjutan (Bag.1-6)

Total questions: 70

Worksheet time: 1hrs 10mins

Name
Class
Date
1.
Which of the following is a correct way to create a variable in Lua?
a)
var myNumber = 10
b)
int myNumber = 10
c)
local myNumber = 10
d)
define myNumber = 10
2.
What data type is "Hello World"?
a)
Boolean
b)
Number
c)
String
d)
Decimal
3.
What data type is true?
a)
String
b)
Boolean
c)
Number
d)
None
4.
What data type is 42.5?
a)
Integer
b)
String
c)
Boolean
d)
Decimal
5.
What will the following script print? local name = "Alex" print("Hello " .. name)
a)
HelloAlex
b)
Hello Alex
c)
AlexHello
d)
nameHello
6.
Which is the correct operator to combine strings in Lua?
a)
+
b)
&
c)
..
d)
*
7.
Which of these is a script object in Roblox Studio?
a)
TextBox
b)
Script
c)
Baseplate
d)
ImageLabel
8.
What is the correct way to access the Transparency of the Baseplate?
a)
Baseplate.Transparency
b)
game.Baseplate.Transparency
c)
Workspace.Baseplate.Transparency
d)
game.Workspace.Baseplate.Transparency
9.
What will this script do? game.Workspace.Baseplate.Transparency = 1
a)
Make Baseplate invisible
b)
Delete Baseplate
c)
Change Baseplate color
d)
Make Baseplate bigger
10.
What is the default value of Transparency?
a)
0
b)
1
c)
true
d)
false
11.
What does this code output? print(5 + 3 * 2)
a)
16
b)
11
c)
13
d)
10
12.
What will be the value of x? local x = 10 % 3
a)
1
b)
3
c)
0
d)
2
13.
Which symbol is used for exponentiation in Lua?
a)
^
b)
**
c)
exp
d)
^^
14.
What is the result of 2^3?
a)
6
b)
8
c)
9
d)
4
15.
What will be printed? local x = 4 print("Value is: " .. x)
a)
4
b)
Value is: x
c)
Value is: 4
d)
x is 4
16.
Which is a correct way to add 1 to a variable?
a)
x + 1
b)
x =+ 1
c)
x += 1
d)
x = x + 1
17.
What does x ~= y mean?
a)
x equals y
b)
x not equals y
c)
x greater than y
d)
x smaller than y
18.
Which operator means “greater than”?
a)
<
b)
0
c)
>
d)
>=
19.
What will this code return? print(10 > 5)
a)
true
b)
false
c)
5
d)
10
20.
Which of the following is NOT a valid comparison operator?
a)
0
b)
!=
c)
~=
d)
<=
21.
Which operator is used for “and” in Lua?
a)
&&
b)
and
c)
&
d)
+
22.
What does this code return? print(true and false)
a)
true
b)
false
c)
and
d)
nil
23.
What does or return if both values are false?
a)
false
b)
true
c)
nil
d)
0
24.
What does not true return?
a)
true
b)
false
c)
error
d)
nil
25.
What is the result of true or false?
a)
false
b)
true
c)
or
d)
nil
26.
What is the structure of an if statement in Lua?
a)
if (condition) then ... end
b)
if condition { ... }
c)
if condition do ...
d)
if condition then ... done
27.
What will this code print? local x = 5 if x > 3 then print("Yes") end
a)
Yes
b)
No
c)
Nothing
d)
Error
28.
What will happen if condition is false in an if statement?
a)
Code runs
b)
Code skipped
c)
Error occurs
d)
Output is 0
29.
What is the keyword to add an alternative block in an if statement?
a)
otherwise
b)
else
c)
next
d)
elseif
30.
Which keyword ends an if block?
a)
stop
b)
exit
c)
done
d)
end
31.
What will this code do? local size = 10 game.Workspace.Part.Size = Vector3.new(size, 1, 1)
a)
Change only the Y size of Part
b)
Set X to 10, Y and Z to 1
c)
Set all sizes to 10
d)
Error in Vector3
32.
What does this code do? local height = 5 game.Workspace.Part.Position = Vector3.new(0, height + 2, 0)
a)
Position at (0,5,0)
b)
Position at (0,2,0)
c)
Position at (0,7,0)
d)
Error in Position
33.
Which value is correct to increase transparency slowly?
a)
Transparency = 0
b)
Transparency = 1.5
c)
Transparency = Transparency + 0.1
d)
Transparency = "0.1"
34.
Which line changes the BrickColor of a part?
a)
Part.BrickColor = 255
b)
Part.Color = Red
c)
Part.BrickColor = BrickColor.new("Really red")
d)
Part.Name = BrickColor
35.
What will happen here? local p = game.Workspace.Part p.Size = p.Size + Vector3.new(1, 0, 0)
a)
Error
b)
Increases X size by 1
c)
All sizes become 1
d)
Sets size to zero
36.
What’s the error in this code? local number = "5" print(number + 2)
a)
No error
b)
It prints 7
c)
Error: trying to add string and number
d)
Error: print needs string
37.
Why does this code give an error? print(game.Workspace.MyPart.Namee)
a)
Namee is undefined property
b)
MyPart doesn’t exist
c)
Both A and B
d)
No error
38.
Which of the following causes runtime error?
a)
print("Hello" .. "World")
b)
print(10 / 2)
c)
print(nil + 1)
d)
print(true)
39.
What is the error in this code? local 2name = "John"
a)
Syntax error: variable can't start with a number
b)
Cannot use local
c)
Missing string quotes
d)
None
40.
Which code is valid?
a)
local var-name = 10
b)
local myVar = 5 + "1"
c)
local size = Vector3.new(1, 2, 3)
d)
local true = "hello"
41.
What will this code print? local x = 10 if x > 20 then print("A") elseif x > 5 then print("B") else print("C") end
a)
A
b)
B
c)
C
d)
Error
42.
What is the correct structure of an elseif chain in Lua?
a)
else if
b)
elseif
c)
elif
d)
else-if
43.
When is the 'else' block executed?
a)
Always
b)
When all conditions are false
c)
Only when if is true
d)
Only with variables
44.
What will this code output? local score = 80 if score > 90 then print("Excellent") elseif score > 70 then print("Good") else print("Try again") end
a)
Excellent
b)
Good
c)
Try again
d)
Error
45.
Which is true about IF-ELSE blocks?
a)
end is optional
b)
then is not required
c)
Only one condition runs
d)
All conditions always run
46.
What does this code do? game.Workspace.Part.Name = "StartPoint"
a)
Changes the color
b)
Deletes the part
c)
Renames the part
d)
Moves the part
47.
What type of value does .Size expect?
a)
BrickColor
b)
string
c)
Vector3
d)
boolean
48.
What will this code do? game.Workspace.Part.Color = Color3.fromRGB(255, 0, 0)
a)
Set color to green
b)
Set color to red
c)
Set transparency
d)
Error
49.
Which one is correct to rename a part?
a)
Part = "NewName"
b)
Part.Name = "NewName"
c)
Part.newName = true
d)
rename(Part)
50.
What does this line do? Part.Transparency = 0.5
a)
Makes the part solid
b)
Makes part semi-transparent
c)
Deletes the part
d)
Changes part to red
51.
Which variable name is valid in Lua?
a)
1score
b)
my score
c)
my_score
d)
end
52.
What’s wrong with this code? if x = 5 then print("Yes") end
a)
Nothing
b)
0
c)
Missing end
d)
Should use else
53.
Which code is better?
a)
x=5 y=10 print(x+y)
b)
local x = 5 local y = 10 print(x + y)
c)
let x = 5; let y = 10; print(x + y)
d)
print(x = 5 + 10)
54.
Why use local when declaring variables?
a)
Makes variables global
b)
Saves memory
c)
Prevents errors and keeps variables local
d)
Increases performance
55.
What is the result of this code? local name = "John" print("Hello, " .. name)
a)
Hello, name
b)
Hello, John
c)
John, Hello
d)
Error
56.
What does Vector3.new(1,1,1) represent?
a)
Position
b)
Rotation
c)
Size/Scale
d)
Transparency
57.
What happens when you set Transparency to 2?
a)
Fully visible
b)
Fully invisible
c)
Error
d)
Slightly transparent
58.
What’s the error here? local Part = game.Workspace:FindFirstChild("MyPart") Part.Color = "Red"
a)
Red is not a Color3
b)
Can't find part
c)
Must use BrickColor
d)
Both A and B
59.
What does this code do? if true and false then print("Works") else print("Fails") end
a)
Works
b)
Fails
c)
true
d)
false
60.
What’s the logic of this condition? if not false then print("Yes") end
a)
No output
b)
Yes
c)
Error
d)
false
61.
What type is Vector3.new(0, 5, 0)?
a)
Boolean
b)
Number
c)
Vector3
d)
String
62.
What’s the correct way to compare equality?
a)
x = y
b)
x == y
c)
x === y
d)
compare(x,y)
63.
How to increase a variable by 3?
a)
x += 3
b)
x = x + 3
c)
x++
d)
x + 3 = x
64.
Which property makes parts disappear?
a)
Color
b)
Size
c)
Transparency
d)
Name
65.
What happens with this code? if x > 5 then print("High") elif x < 5 then print("Low") else print("Equal") end
a)
High
b)
Low
c)
Equal
d)
Depends on x
66.
What happens if we write this? local name = "Alex" print(name .. 5)
a)
Error
b)
Alex5
c)
5Alex
d)
name5
67.
Which keyword makes variable accessible only inside block?
a)
global
b)
local
c)
var
d)
private
68.
What will this return? print(type("Hello"))
a)
String
b)
Text
c)
Hello
d)
"String"
69.
Which is better for checking if a part exists?
a)
game.Workspace.Part
b)
game.Workspace:FindFirstChild("Part")
c)
game:GetService("Workspace")
d)
Part.exists
70.
What is the result of this? local a = true local b = false print(a or b)
a)
false
b)
true
c)
nil
d)
error