Skip to content

Remote Functions

Client-side methods available through the PartyRemoteFunction.

Setup

The system automatically creates a RemoteFunction named PartyRemoteFunction in ReplicatedStorage. Access it from the client:

lua
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local remoteFunction = ReplicatedStorage:WaitForChild("PartyRemoteFunction")

Available Methods

Party Creation

lua
local success = remoteFunction:InvokeServer("CreateParty"): bool

Example:

lua
local success = remoteFunction:InvokeServer("CreateParty")
if success then
    print("Party created successfully")
else
    print("Failed to create party")
end

Member Management

Invite Player

lua
local success = remoteFunction:InvokeServer("InvitePlayer", targetPlayer: Player): bool

Example:

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

Accept Invite

lua
local success = remoteFunction:InvokeServer("AcceptInvite", partyId: string): bool

Example:

lua
local success = remoteFunction:InvokeServer("AcceptInvite", "12345")
if success then
    print("Invite accepted")
else
    print("Failed to accept invite")
end

Leave Party

lua
local success = remoteFunction:InvokeServer("LeaveParty"): bool

Example:

lua
local success = remoteFunction:InvokeServer("LeaveParty")
if success then
    print("Left the party successfully")
else
    print("Failed to leave the party")
end

Kick Member

lua
local success = remoteFunction:InvokeServer("KickMember", memberToKick: Player): bool

Example:

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

Party Settings

Transfer Ownership

lua
local success = remoteFunction:InvokeServer("TransferOwnership", newLeader: Player): bool

Example:

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

Toggle Invite Only

lua
local success = remoteFunction:InvokeServer("ToggleInviteOnly", toggle: bool): bool

Example:

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

Set Max Members

lua
local success = remoteFunction:InvokeServer("SetMaxMembers", maxMembers: number): bool

Example:

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

Set Party Name

lua
local success = remoteFunction:InvokeServer("SetPartyName", name: string): bool

Example:

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

Permissions

Set Permission

lua
local success = remoteFunction:InvokeServer("SetPermission", member: Player, perm: string, toggle: bool): bool

Example:

lua
local success = remoteFunction:InvokeServer("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

Invite Management

Revoke Invite

lua
local success = remoteFunction:InvokeServer("RevokeInvite", player: Player): bool

Example:

lua
local success = remoteFunction:InvokeServer("RevokeInvite", game.Players.Player2)
if success then
    print("Invite revoked for Player2")
else
    print("Failed to revoke invite for Player2")
end

Party Information

Get Party

lua
local success, party = remoteFunction:InvokeServer("GetParty", targetPlayer: Player): (bool, Party | nil)

Example:

lua
local success, party = remoteFunction:InvokeServer("GetParty", game.Players.Player2)
if success then
    print("Party information retrieved")
    print("Party Name:", party.PartyName)
else
    print("Failed to retrieve party information")
end

Error Handling

All methods return true on success and false on failure. Failures are logged server-side with explanatory warnings.

Released under the MIT License.