RPS = {}
RPS[1] = "Rock"
RPS[2] = "Paper"
RPS[3] = "Scissors"
function RPS()
playerOne = math.random( #RPS )
playerTwo = math.random( #RPS )
if playerOne == playerTwo then
print("It is a tie\n Player One played "..playerOne.."\n Player Two played "..playerTwo..)
elseif playerOne == RPS[1] then
if playerTwo == RPS[2] then
print("Player Two wins\n Player One played "..playerOne.."\n Player Two played "..playerTwo..)
else
print("Player One wins\n Player One played "..playerOne.."\n Player Two played "..playerTwo..)
end
elseif playerOne == RPS[2] then …Run Code Online (Sandbox Code Playgroud) lua ×1