This is my code

The first person in the variable works as in me but for ilostitall2 he can't activate the the rs output.
This is running on a mindcrack ftb server.
Posted 24 April 2013 - 08:42 AM

Posted 24 April 2013 - 08:53 AM
i = "robertgdalton" g = "ilositall2" if player == i or player == g then --success end
Posted 24 April 2013 - 09:05 AM
Cranium, on 24 April 2013 - 08:53 AM, said:
i = "robertgdalton" g = "ilositall2" if player == i or player == g then --success end
Posted 24 April 2013 - 09:43 AM
local users = {
"Name1",
"Name2",
"Name3"
}
local input = read()
for i = 1, #users, 1 do
if input == users[i] then
--Do something
else
print"You aren't on the list"
end
end
If you want to add a new name, go into the users table and make a comma after the last entry then go into a new line and add a new name in quotation marks Posted 24 April 2013 - 09:46 AM
Freack100, on 24 April 2013 - 09:43 AM, said:
local users = {
"Name1",
"Name2",
"Name3"
}
local input = read()
for i = 1, #users, 1 do
if input == users[i] then
--Do something
else
print"You aren't on the list"
end
end
If you want to add a new name, go into the users table and make a comma after the last entry then go into a new line and add a new name in quotation marks local people =
{
["Player1"] = true,
["Player2"] = false,
["Player3"] = true
}
local input = read()
if people[input] then
--Do something
else
print("Sorry, you're not on the list.")
end
Posted 24 April 2013 - 09:51 AM
digpoe, on 24 April 2013 - 09:46 AM, said:
Freack100, on 24 April 2013 - 09:43 AM, said:
local users = {
"Name1",
"Name2",
"Name3"
}
local input = read()
for i = 1, #users, 1 do
if input == users[i] then
--Do something
else
print"You aren't on the list"
end
end
If you want to add a new name, go into the users table and make a comma after the last entry then go into a new line and add a new name in quotation marks local people =
{
["Player1"] = true,
["Player2"] = false,
["Player3"] = true
}
local input = read()
if people[input] then
--Do something
else
print("Sorry, you're not on the list.")
end
Posted 24 April 2013 - 09:55 AM
Freack100, on 24 April 2013 - 09:51 AM, said:
digpoe, on 24 April 2013 - 09:46 AM, said:
Freack100, on 24 April 2013 - 09:43 AM, said:
local users = {
"Name1",
"Name2",
"Name3"
}
local input = read()
for i = 1, #users, 1 do
if input == users[i] then
--Do something
else
print"You aren't on the list"
end
end
If you want to add a new name, go into the users table and make a comma after the last entry then go into a new line and add a new name in quotation marks local people =
{
["Player1"] = true,
["Player2"] = false,
["Player3"] = true
}
local input = read()
if people[input] then
--Do something
else
print("Sorry, you're not on the list.")
end
function isAllowed(text)
return (people[text] == true and "") or "Sorry, you're not allowed."
end
local people =
{
["Player1"] = true,
["Player2"] = false,
["Player3"] = true
}
local input = read()
print(isAllowed(input))
Posted 24 April 2013 - 11:26 AM
local allowed = "Player1 Player2 Player3" local input = read() if allowed:find(input) then --success end
0 members, 2 guests, 0 anonymous users