To compare values, you need to use ==, not =.
= assignment
== comparison
Example:
valueA = 10 -- assing the value 10 to valueA
valueB = "Hello" -- assing the value "Hello" to valueB
if valueA == valueB then -- compare valueA and valueB
-- do something
end
Also, to make a loop, use for or while:
while <condition> do
-- code
end
for i = 1, 10 do
-- code
end
Fixed code:
local pass = "Startclan's lights"
local tries = 3
print("welcome")
print(" password: ")
for triesnum = 1, tries do
local password = read()
if password = pass then
print ("acess granted")
break -- break the loop
else
print ("acess denied try again")
end
end
if triesnum == tries then
print ("acess denied.")
end