Skip to content

Party Methods

Methods available on party instances for managing members, permissions, and party settings.

Member Management

Invite Player

lua
party:InvitePlayer(player: Player): bool
party:InvitePlayerByUsername(username: string): bool

Invites a player to the party. Requires CanInvite permission.

Example:

lua
local success = party:InvitePlayer(game.Players.Player2)
if success then
    print("Invite sent to Player2")
else
    print("Failed to send invite to Player2")
end

Add Member

lua
party:AddMember(member: Player): bool

Adds a member to the party after they've accepted an invite.

Example:

lua
local success = party:AddMember(game.Players.Player2)
if success then
    print("Player2 added to the party")
else
    print("Failed to add Player2 to the party")
end

Remove Member

lua
party:RemoveMember(member: Player): bool  -- For kicking (requires permission)
party:LeaveParty(member: Player): bool    -- For voluntary leaving

Removes a member from the party.

Example:

lua
local success = party:RemoveMember(game.Players.Player2)
if success then
    print("Player2 was kicked from the party")
else
    print("Failed to kick Player2 from the party")
end

Transfer Ownership

lua
party:TransferOwnership(newLeader: Player): bool

Transfers party leadership to another member.

Example:

lua
local success = party:TransferOwnership(game.Players.Player2)
if success then
    print("Leadership transferred to Player2")
else
    print("Failed to transfer leadership to Player2")
end

Party Settings

Maximum Members

lua
party:SetMaxMembers(maxMembers: number): bool

Sets the maximum number of allowed party members.

Example:

lua
local success = party:SetMaxMembers(6)
if success then
    print("Maximum members set to 6")
else
    print("Failed to set maximum members")
end

Party Name

lua
party:SetPartyName(name: string): bool

Changes the party's display name.

Example:

lua
local success = party:SetPartyName("My Cool Party")
if success then
    print("Party name changed to 'My Cool Party'")
else
    print("Failed to change party name")
end

Invite Only

lua
party:ToggleInviteOnly(toggle: bool): bool

Sets whether the party requires invites to join.

Example:

lua
local success = party:ToggleInviteOnly(true)
if success then
    print("Party is now invite-only")
else
    print("Failed to set party to invite-only")
end

Permissions

Set Permission

lua
party:SetPermission(member: Player, perm: string, toggle: bool): bool

Grants or revokes specific permissions for a member.

Example:

lua
local success = party:SetPermission(game.Players.Player2, "CanKick", true)
if success then
    print("Player2 can now kick members")
else
    print("Failed to grant kick permission to Player2")
end

Check Permission

lua
local hasPermission = party:HasPermission(member: Player, perm: string): bool

Checks if a member has a specific permission.

Example:

lua
local canKick = party:HasPermission(game.Players.Player2, "CanKick")
if canKick then
    print("Player2 can kick members")
else
    print("Player2 cannot kick members")
end

Blacklist Management

Blacklist Player

lua
party:BlacklistPlayer(player: Player): bool

Blacklists a player from the party.

Example:

lua
local success = party:BlacklistPlayer(game.Players.Player2)
if success then
    print("Player2 was blacklisted")
else
    print("Failed to blacklist Player2")
end

Unblacklist Player

lua
party:UnblacklistPlayer(player: Player): bool

Removes a player from the blacklist.

Example:

lua
local success = party:UnblacklistPlayer(game.Players.Player2)
if success then
    print("Player2 was unblacklisted")
else
    print("Failed to unblacklist Player2")
end

Clear Blacklist

lua
party:ClearBlacklist(): bool

Clears the blacklist.

Example:

lua
local success = party:ClearBlacklist()
if success then
    print("Blacklist cleared")
else
    print("Failed to clear blacklist")
end

Teleportation

lua
party:TeleportMembers(placeId: number, {
    code = "serverCode",    -- optional
    job = "jobId",         -- optional
    reserve = true         -- optional
}): bool

Teleports party members to a specified place.

Example:

lua
local success = party:TeleportMembers(123456789, { code = "serverCode", reserve = true })
if success then
    print("Party members teleported")
else
    print("Failed to teleport party members")
end

Utility Methods

Get Members

lua
local members = party:GetMembers(): {Player}

Returns the list of current party members.

Example:

lua
local members = party:GetMembers()
for _, member in ipairs(members) do
    print("Party member:", member.Name)
end

Get Invites

lua
local invites = party:GetInvites(): {Player}

Returns the list of players who have been invited to the party.

Example:

lua
local invites = party:GetInvites()
for _, invite in ipairs(invites) do
    print("Invited player:", invite.Name)
end

Get Blacklist

lua
local blacklist = party:GetBlacklist(): {Player}

Returns the list of blacklisted players.

Example:

lua
local blacklist = party:GetBlacklist()
for _, player in ipairs(blacklist) do
    print("Blacklisted player:", player.Name)
end

Check Status

lua
local isMember = party:IsMember(player: Player): bool
local isLeader = party:IsLeader(player: Player): bool
local isInviteOnly = party:IsInviteOnly(): bool

Checks various statuses of the party.

Example:

lua
local isMember = party:IsMember(game.Players.Player2)
if isMember then
    print("Player2 is a member of the party")
else
    print("Player2 is not a member of the party")
end

local isLeader = party:IsLeader(game.Players.Player1)
if isLeader then
    print("Player1 is the leader of the party")
else
    print("Player1 is not the leader of the party")
end

local isInviteOnly = party:IsInviteOnly()
if isInviteOnly then
    print("The party is invite-only")
else
    print("The party is not invite-only")
end

Released under the MIT License.