Status
Read-only text you update from code.
The smallest status#
local status = main:Status({ Text = "Connection" })
status:Set("connected")Preview
My Script
v1.0
Search…
Ember v1Status
idle
Options#
| Option | Type | Default | What it does |
|---|---|---|---|
Textreq | string | — | The label on the left. |
Default | string | "-" | The starting value on the right. |
Callback | function(string) | — | Called with the new text every time Set runs. |
Description | string | — | A quieter second line. |
Icon | string | — | An icon shown before the label. |
Save | string | boolean | — | Persist the value under this key. true derives one from the section and label. |
Tooltip | string | — | Shown while the pointer is over the control. |
Disabled | boolean | false | Dims the control. There is nothing to refuse. |
DisabledReason | string | — | Shown as a tooltip while it is disabled. |
Methods#
| Method | Returns | What it does |
|---|---|---|
Set(text) | true, or false, reason | Replaces the value shown on the right and fires Callback. nil is refused |
Set(text, true) | true | The same without firing Callback |
Get() | string | The text currently shown |
The user cannot change a status, so Callback only ever runs from your own
Set. A saved status calls it once with the value it restored, the same as
every other saved control. See
Saving settings.
Using it#
A status is for anything the user should see but not change, such as a connection state or a count.
local found = main:Status({ Text = "Players found", Default = "0" })
game.Players.PlayerAdded:Connect(function()
found:Set(tostring(#game.Players:GetPlayers()))
end)Non-strings are fine
Values are coerced, so status:Set(42) works and shows 42. The tostring in
the example above is there for clarity, not because it is needed.
For anything that needs attention right away, like a job finishing or failing, use a notification.