Skip to main content

SlaveClock

Slave clock on the client

Functions

new

SlaveClock.new(
remoteEventRemoteEvent,
remoteFunctionRemoteFunction
) → SlaveClock

Constructs a new SlaveClock

GetClockFunction

SlaveClock:GetClockFunction() → function

Gets a function that can be used as a clock, like time and tick are.

TickToSyncedTime

SlaveClock:TickToSyncedTime(syncedTimenumber) → number

Converts the syncedTime to the original tick value.

GetTime

SlaveClock:GetTime() → number

Returns the sycncronized time

IsSynced

SlaveClock:IsSynced() → boolean

Returns true if the manager has synced with the server

GetPing

SlaveClock:GetPing() → number

Returns estimated ping in seconds

Show raw api
{
    "functions": [
        {
            "name": "new",
            "desc": "Constructs a new SlaveClock",
            "params": [
                {
                    "name": "remoteEvent",
                    "desc": "",
                    "lua_type": "RemoteEvent"
                },
                {
                    "name": "remoteFunction",
                    "desc": "",
                    "lua_type": "RemoteFunction"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "SlaveClock"
                }
            ],
            "function_type": "static",
            "source": {
                "line": 23,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        },
        {
            "name": "GetClockFunction",
            "desc": "Gets a function that can be used as a clock, like `time` and `tick` are.",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "function"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 51,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        },
        {
            "name": "TickToSyncedTime",
            "desc": "Converts the syncedTime to the original tick value.",
            "params": [
                {
                    "name": "syncedTime",
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 64,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        },
        {
            "name": "GetTime",
            "desc": "Returns the sycncronized time",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 72,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        },
        {
            "name": "IsSynced",
            "desc": "Returns true if the manager has synced with the server",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "boolean"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 84,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        },
        {
            "name": "GetPing",
            "desc": "Returns estimated ping in seconds",
            "params": [],
            "returns": [
                {
                    "desc": "",
                    "lua_type": "number"
                }
            ],
            "function_type": "method",
            "source": {
                "line": 97,
                "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
            }
        }
    ],
    "properties": [],
    "types": [],
    "name": "SlaveClock",
    "desc": "Slave clock on the client",
    "source": {
        "line": 5,
        "path": "src/timesyncservice/src/Shared/Clocks/SlaveClock.lua"
    }
}