# Score UI

### Video

{% embed url="https://www.youtube.com/watch?v=mkgtrdlXp-Q" %}

### Example

```lua
RegisterCommand("createScore",function()
    local data = {
        visible =  true,
        leftScore = tostring(math.random(0,30)),
        rightScore = tostring(math.random(0,30)),
        leftScoreColor = `COLOR_BLUE`,
        rightScoreColor = `COLOR_RED`,
        leftScoreTextColor = `COLOR_BLACK`,
        rightScoreTextColor = `COLOR_BLACK`,
        timerString = "", -- Must be string
        timerMessageString = "" -- Must be string
    }
    local score = exports["qadr_ui"]:createScore(data)
    Wait(2000)
    local data = {
        visible =  true,
        leftScore = tostring(math.random(0,30)),
        rightScore = tostring(math.random(0,30))
    }
    score:update(data)
    Wait(3000)
    local data = {
        visible =  true,
        leftScore = tostring(math.random(0,30)),
        rightScore = tostring(math.random(0,30))
    }
    score:update(data)
    Wait(3000)
    local data = {
        visible =  false,
        leftScore = tostring(math.random(0,30)),
        rightScore = tostring(math.random(0,30))
    }
    score:update(data)
    Wait(3000)
    local data = {
        visible =  true,
        leftScore = tostring(math.random(0,30)),
        rightScore = tostring(math.random(0,30))
    }
    score:update(data)
    Wait(3000)
    score:clear()
end)
```
