First, you should indent your code correctly. It makes it much easier to read, and therefore much easier to catch mistakes. Likewise, you should generally use spaces whenever possible to split things up visually, such as around operators like (<) and (>).
while true do
wait(1)
local type = math.random(1,10)
if type < 7 then
print("grass")
elseif type > 6 < 9 then
print("road")
elseif type > 8 < 11 then
print("water")
end
end
Although it isn't related to the error you're having, you should avoid defining a variable named type. That's because type is a function that's built-in to Lua which tells you the type of a parameter (type(4) is "number" and type("hello!") is "string").
The main source of your error, though, it exactly where it's telling you. On line 7, you're attempting to compare a number with a boolean.
Why?
We have this expression to evaluate: type > 6 < 9. Okay, let's pretend that we say type = 7 just before this. How does Lua understand this?
type = 7
So we want to evaluate this:
type > 6 < 9
Let's plug in type's value:
7 > 6 < 9
As Lua understand this code, there are parentheses there. Even though you didn't write them, they're implied by the parsing rules. I'll show them to you:
(7 > 6) < 9
Okay, great. So let's evaluate what's inside the parentheses.
Since 7 > 6 is obviously true, we get (true).
(true) < 9
And now drop those pointless parentheses:
true < 9
But what is this supposed to mean? I don't know whether true is more or less than 9. Lua doesn't either, that's why it's crashing.
What you actually want to say is:
type > 6 and type < 9
The and operator (it's not a variable) takes something at its left and its right. If they're both true, then the result is true. Otherwise it's false. (Technically it is more complicated than this. Until you understand the above, however, ignore this bit: The left argument is evaluated; if it is falsey, it is returned, otherwise the right argument is evaluated and returned).
So we can fix your code by writing:
while true do
wait(1)
local type = math.random(1,10)
if type < 7 then
print("grass")
elseif type > 6 and type < 9 then
print("road")
elseif type > 8 and type < 11 then
print("water")
end
end