Skip to main content

Role.ExtendExpiry

Server
Lyn.Player.Role.ExtendExpiry(Player target, string role, number duration, function|nil callback)Function

Description

Adds time to an existing temporary role instead of overwriting it.

  • If the role isn't assigned (or already expired), it's set to now + duration.
  • If the role is permanent (expires_at = 0), nothing changes.
  • Otherwise the current expiry is extended by duration.

Params

  1. Player target
  2. string role
  3. number duration
    in seconds, must be greater than 0
  4. function | nil callback

    Callback params(s):

    1. string | nil err
tip

Fires the Lyn.Player.Role.Add hook with the new expires_at.