Home / Player

p:isOp()

p:isOp()

Queries operator status.

Parameters

None.

Returns

A boolean indicating whether this player is an operator.

Example

command('adminchat', function(sender, args)
  if not sender:isOp() then
    sender:send("Operators only.")
    return true
  end
  server.broadcast("[Admin] " .. sender.name .. ": " .. table.concat(args, " "))
  return true
end)

Notes

This page documents the player wrapper method. Command sender:isOp() also works for the console sender, which returns true.