View Single Post
winning = 0

function winscore()
    Player1_Score = get_player_info(1).injury
    Player2_Score = get_player_info(0).injury
    if(Player1_Score > Player2_Score) then
        echo("Player 1 is winning by" .. " " .. math.floor(Player1_Score - Player2_Score))
        winning = 1
    elseif(Player2_Score > Player1_Score) then
        echo("Player 2 is winning by" .. " " .. math.floor(Player2_Score - Player1_Score))
        winning = 2
    else
        echo("It's a draw!")
        winning = 0
    end
end

function draw()
    if(winning == 1) then
        set_color(1,0,0,0.2)
    elseif(winning == 2) then
        set_color(0,0,1,0.2)
    else
        set_color(1,1,1,0.2)
    end
    draw_quad(10,300,100,200)
end

add_hook("draw2d","draw",draw)
add_hook("enter_freeze","echowinner",winscore)
If you don't understand any of it, just say
:D