Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local function player(num)
- while true do
- if turn == num then
- local d1 = math.random(1, 6)
- local d2 = math.random(1, 6)
- local moveCount = d1 + d2
- print("Player "..num.." rolled a "..d1.." and a "..d2.."...")
- if d1 == d2 then
- print("Doubles! Rolling again.")
- local d1 = math.random(1, 6)
- local d2 = math.random(1, 6)
- local moveCount = moveCount + d1 + d2
- if d1 == d2 then
- print("Doubles! Rolling again for a second time.")
- local d1 = math.random(1, 6)
- local d2 = math.random(1, 6)
- local moveCount = moveCount + d1 + d2
- end
- end
- if num == 1 then
- spaceP1 = spaceP1 + moveCount
- if board[spaceP1].owner == 0 then
- if (type == 1 or type == 2 or type == 7) and (bank >= price + 200) then
- local isBuying = math.random(1, 4)
- if isBuying == 1 then
- isBuying = true
- end
- if isBuying == true then
- players[1].properties[#players[1].properties+1] = board[spaceP1].spaceNum
- players[1].bank = players[1].bank - board[spaceP1].price
- board[spaceP1].owner = 1
- end
- end
- end
- elseif num == 2 then
- spaceP2 = spaceP2 + moveCount
- elseif num == 3 then
- spaceP3 = spaceP3 + moveCount
- elseif num == 4 then
- spaceP4 = spaceP4 + moveCount
- elseif num == 5 then
- spaceP5 = spaceP5 + moveCount
- elseif num == 6 then
- spaceP6 = spaceP6 + moveCount
- end
- end
- if turn < 6 then
- turn = turn + 1
- elseif turn == 6 then
- turn = 1
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement