Learn
Engine Class
SocialService
Not Creatable
Service
Not Replicated


API Reference
Methods
CanSendCallInviteAsync
Yields
Capabilities: Social
SocialService:CanSendCallInviteAsync(player:Instance):boolean
Parameters
player:Instance
Returns
Code Samples
SocialService:PromptPhoneBook()
local Players = game:GetService("Players")
local SocialService = game:GetService("SocialService")
local player = Players.LocalPlayer
local button = script.Parent
button.Visible = false
-- Function to check whether the player can send a call invite
local function canSendCallingInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendCallInviteAsync(sendingPlayer)
end)
return success and canSend
end
local canCall = canSendCallingInvite(player)
if canCall then
button.Visible = true
button.Activated:Connect(function()
SocialService:PromptPhoneBook(player, "")
end)
end

CanSendGameInviteAsync
Yields
Capabilities: Social
SocialService:CanSendGameInviteAsync(
player:Instance, recipientId:User
Parameters
player:Instance
recipientId:User
Default Value: "U1.AQAAAAAAAAAAAAAAAAAAAAA"
Returns
Code Samples
Sending an Invite
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- Function to check whether the player can send an invite
local function canSendGameInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendGameInviteAsync(sendingPlayer)
end)
return success and canSend
end
local canInvite = canSendGameInvite(player)
if canInvite then
SocialService:PromptGameInvite(player)
end

GetEventRsvpStatusAsync
Yields
Capabilities: Social
SocialService:GetEventRsvpStatusAsync(eventId:string):Enum.RsvpStatus
Parameters
eventId:string
Code Samples
SocialService:PromptRsvpToEventAsync()
local SocialService = game:GetService("SocialService")
local EVENT_ID = "YOUR_EVENT_ID"
local followPrompt: ProximityPrompt = script.Parent.FollowProximityPrompt
local unFollowPrompt: ProximityPrompt = script.Parent.UnfollowProximityPrompt
local function updatePrompt(rsvpStatus: Enum.RsvpStatus)
if rsvpStatus == Enum.RsvpStatus.Going then
unFollowPrompt.Enabled = true
followPrompt.Enabled = false
else
unFollowPrompt.Enabled = false
followPrompt.Enabled = true
end
end
local success, currentRsvpStatus = pcall(function()
return SocialService:GetEventRsvpStatusAsync(EVENT_ID)
end)
if not success then
-- Could not retrieve RSVP status; don't enable either proximity prompt
warn("Failed to get RSVP status:", currentRsvpStatus)
return
end
print("CurrentRsvpStatus:", currentRsvpStatus)
updatePrompt(currentRsvpStatus)
unFollowPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)
followPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)

GetExperienceEventAsync
Yields
Capabilities: Social
SocialService:GetExperienceEventAsync(eventId:string):ExperienceEvent?
Parameters
eventId:string
Returns
ExperienceEvent?
Code Samples
SocialService:GetUpcomingExperienceEventsAsync()
local SocialService = game:GetService("SocialService")
-- Discover the next upcoming/active event and prompt the player to RSVP
local function promptNextUpcomingEvent()
local success, eventsOrError = pcall(function()
return SocialService:GetUpcomingExperienceEventsAsync()
end)
if not success then
warn("Failed to load upcoming events:", eventsOrError)
return
end
local upcomingEvents = eventsOrError
local selectedEvent
for _, event in ipairs(upcomingEvents) do
if not event.HasStarted and not event.HasEnded then
selectedEvent = event
break
end
end
if selectedEvent then
local success, result = pcall(function()
return SocialService:PromptRsvpToEventAsync(selectedEvent.Id)
end)
if not success then
warn("RSVP prompt failed:", result)
end
else
warn("No future events available to prompt.")
return
end
end
promptNextUpcomingEvent()

GetPartyAsync
Yields
Capabilities: Social
SocialService:GetPartyAsync(partyId:string):{any}
Parameters
partyId:string
Returns
Code Samples
SocialService:GetPartyAsync()
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local partyId = player.PartyId
if partyId == "" then
warn("Player is not in a party")
return
end
local success, partyData = pcall(function()
return SocialService:GetPartyAsync(partyId)
end)
if success and partyData then
for _, partyMemberData in partyData do
print(
partyMemberData.UserId,
partyMemberData.PlaceId,
partyMemberData.JobId,
partyMemberData.PrivateServerId,
partyMemberData.ReservedServerAccessCode
)
end
else
warn("Failed to retrieve party data")
end
end)

GetPlayersByPartyId
Capabilities: Social
SocialService:GetPlayersByPartyId(partyId:string):{Player}
Parameters
partyId:string
Returns
Code Samples
SocialService:GetPlayersByPartyId()
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
local partyId = player.PartyId
if partyId ~= "" then
local partyPlayers: { Player } = SocialService:GetPlayersByPartyId(partyId)
for _, partyMember in partyPlayers do
print("Party Member: " .. partyMember.Name)
end
else
warn("Player is not in a party")
end
end)
Team Rebalance with Party Integration
local Teams = game:GetService("Teams")
local Players = game:GetService("Players")
local SocialService = game:GetService("SocialService")
local redTeam = Instance.new("Team")
redTeam.Name = "Red Team"
redTeam.TeamColor = BrickColor.Red()
redTeam.AutoAssignable = false
redTeam.Parent = Teams
local blueTeam = Instance.new("Team")
blueTeam.Name = "Blue Team"
blueTeam.TeamColor = BrickColor.Blue()
blueTeam.AutoAssignable = false
blueTeam.Parent = Teams
local function assignPlayerToTeam(player)
local partyId = player.PartyId
if partyId == "" then
assignBalancedTeam(player)
return
end
local teams = { redTeam, blueTeam }
local matchingTeam = nil
local partyPlayers = SocialService:GetPlayersByPartyId(partyId)
for _, partyPlayer in partyPlayers do
if partyPlayer ~= player and table.find(teams, partyPlayer.Team) then
matchingTeam = partyPlayer.Team
break
end
end
if matchingTeam then
player.Team = matchingTeam
player.TeamColor = matchingTeam.TeamColor
else
assignBalancedTeam(player)
end
end
function assignBalancedTeam(player)
local redCount = #redTeam:GetPlayers()
local blueCount = #blueTeam:GetPlayers()
local chosenTeam = redCount <= blueCount and redTeam or blueTeam
player.Team = chosenTeam
player.TeamColor = chosenTeam.TeamColor
end
local function groupPlayersByParty()
local seenPartyIds = {}
local groupedPlayers = {}
for _, player in Players:GetPlayers() do
if player.PartyId == "" then
table.insert(groupedPlayers, { player })
elseif not table.find(seenPartyIds, player.PartyId) then
table.insert(seenPartyIds, player.PartyId)
local partyPlayers = SocialService:GetPlayersByPartyId(player.PartyId)
table.insert(groupedPlayers, partyPlayers)
end
end
return groupedPlayers
end
-- Call this function to rebalance teams
local function rebalanceTeams()
local groups = groupPlayersByParty()
table.sort(groups, function(a, b)
return #a > #b
end)
for _, player in Players:GetPlayers() do
player.Team = nil
end
for _, group in groups do
local redCount = #redTeam:GetPlayers()
local blueCount = #blueTeam:GetPlayers()
local bestTeam
if redCount <= blueCount then
bestTeam = redTeam
else
bestTeam = blueTeam
end
for _, player in group do
player.Team = bestTeam
player.TeamColor = bestTeam.TeamColor
end
end
for _, player in Players:GetPlayers() do
player:LoadCharacterAsync()
end
end
Players.PlayerAdded:Connect(function(player)
assignPlayerToTeam(player)
player:LoadCharacterAsync()
player:GetPropertyChangedSignal("PartyId"):Connect(function()
if player.PartyId ~= "" then
assignPlayerToTeam(player)
end
end)
end)

GetUpcomingExperienceEventsAsync
Yields
Capabilities: Social
SocialService:GetUpcomingExperienceEventsAsync():{ExperienceEvent}
Returns
{ExperienceEvent}
Code Samples
SocialService:GetUpcomingExperienceEventsAsync()
local SocialService = game:GetService("SocialService")
-- Discover the next upcoming/active event and prompt the player to RSVP
local function promptNextUpcomingEvent()
local success, eventsOrError = pcall(function()
return SocialService:GetUpcomingExperienceEventsAsync()
end)
if not success then
warn("Failed to load upcoming events:", eventsOrError)
return
end
local upcomingEvents = eventsOrError
local selectedEvent
for _, event in ipairs(upcomingEvents) do
if not event.HasStarted and not event.HasEnded then
selectedEvent = event
break
end
end
if selectedEvent then
local success, result = pcall(function()
return SocialService:PromptRsvpToEventAsync(selectedEvent.Id)
end)
if not success then
warn("RSVP prompt failed:", result)
end
else
warn("No future events available to prompt.")
return
end
end
promptNextUpcomingEvent()

HideSelfView
Capabilities: Social
SocialService:HideSelfView():()
Returns
()

PromptFeedbackSubmissionAsync
Yields
Capabilities: Social
SocialService:PromptFeedbackSubmissionAsync(options:Dictionary?):()
Parameters
options:Dictionary?
Returns
()
Code Samples
SocialService:PromptFeedbackSubmissionAsync()
local SocialService = game:GetService("SocialService")
-- Function to prompt for feedback
local function promptForFeedback()
local success, errorMessage = pcall(function()
SocialService:PromptFeedbackSubmissionAsync()
end)
if success then
print("Feedback prompt completed")
else
warn("Failed to prompt for feedback:", errorMessage)
end
end
-- Prompt for feedback when player reaches a milestone
local function onMilestoneReached()
promptForFeedback()
end
-- Example usage: Connect to a game event
game.ReplicatedStorage.MilestoneReached.OnClientEvent:Connect(onMilestoneReached)
SocialService:PromptFeedbackSubmissionAsync() — Player Support
local SocialService = game:GetService("SocialService")
local function promptPlayerSupport()
local success, errorMessage = pcall(function()
SocialService:PromptFeedbackSubmissionAsync({
FeedbackType = Enum.FeedbackType.PlayerSupport,
})
end)
if success then
print("Player support prompt completed")
else
warn("Failed to prompt for player support:", errorMessage)
end
end
-- Example usage: Connect to a help button in a ScreenGui
local helpButton = script.Parent:WaitForChild("HelpButton")
helpButton.Activated:Connect(function()
task.spawn(promptPlayerSupport)
end)

PromptGameInvite
Capabilities: Social
SocialService:PromptGameInvite(
player:Instance, experienceInviteOptions:Instance
):()
Parameters
player:Instance
experienceInviteOptions:Instance
Default Value: "nil"
Returns
()
Code Samples
Sending an Invite
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
-- Function to check whether the player can send an invite
local function canSendGameInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendGameInviteAsync(sendingPlayer)
end)
return success and canSend
end
local canInvite = canSendGameInvite(player)
if canInvite then
SocialService:PromptGameInvite(player)
end

PromptLinkSharing
Deprecated

PromptLinkSharingAsync
Yields
Capabilities: Social
SocialService:PromptLinkSharingAsync(
player:Player, options:Dictionary
Parameters
player:Player
options:Dictionary
Default Value: "nil"
Returns

PromptPhoneBook
Capabilities: Social
SocialService:PromptPhoneBook(
player:Instance, tag:string
):()
Parameters
player:Instance
tag:string
Returns
()
Code Samples
SocialService:PromptPhoneBook()
local Players = game:GetService("Players")
local SocialService = game:GetService("SocialService")
local player = Players.LocalPlayer
local button = script.Parent
button.Visible = false
-- Function to check whether the player can send a call invite
local function canSendCallingInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendCallInviteAsync(sendingPlayer)
end)
return success and canSend
end
local canCall = canSendCallingInvite(player)
if canCall then
button.Visible = true
button.Activated:Connect(function()
SocialService:PromptPhoneBook(player, "")
end)
end

PromptRsvpToEventAsync
Yields
Capabilities: Social
SocialService:PromptRsvpToEventAsync(eventId:string):Enum.RsvpStatus
Parameters
eventId:string
Code Samples
SocialService:PromptRsvpToEventAsync()
local SocialService = game:GetService("SocialService")
local EVENT_ID = "YOUR_EVENT_ID"
local followPrompt: ProximityPrompt = script.Parent.FollowProximityPrompt
local unFollowPrompt: ProximityPrompt = script.Parent.UnfollowProximityPrompt
local function updatePrompt(rsvpStatus: Enum.RsvpStatus)
if rsvpStatus == Enum.RsvpStatus.Going then
unFollowPrompt.Enabled = true
followPrompt.Enabled = false
else
unFollowPrompt.Enabled = false
followPrompt.Enabled = true
end
end
local success, currentRsvpStatus = pcall(function()
return SocialService:GetEventRsvpStatusAsync(EVENT_ID)
end)
if not success then
-- Could not retrieve RSVP status; don't enable either proximity prompt
warn("Failed to get RSVP status:", currentRsvpStatus)
return
end
print("CurrentRsvpStatus:", currentRsvpStatus)
updatePrompt(currentRsvpStatus)
unFollowPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)
followPrompt.Triggered:Connect(function(player)
local rsvpStatus = SocialService:PromptRsvpToEventAsync(EVENT_ID)
updatePrompt(rsvpStatus)
end)

ShowSelfView
Capabilities: Social
SocialService:ShowSelfView(selfViewPosition:Enum.SelfViewPosition):()
Parameters
selfViewPosition:Enum.SelfViewPosition
Default Value: "LastPosition"
Returns
()

Events
CallInviteStateChanged
Capabilities: Social
SocialService.CallInviteStateChanged(
player:Instance, inviteState:Enum.InviteState
Parameters
player:Instance
inviteState:Enum.InviteState
Code Samples
SocialService.CallInviteStateChanged
local SocialService = game:GetService("SocialService")
local button = script.Parent
local isPhonebookOpen = false
SocialService.CallInviteStateChanged:Connect(function(_, inviteState)
local isCalling = inviteState == Enum.InviteState.Placed
if isCalling or isPhonebookOpen then
button.Visible = false
else
button.Visible = true
end
end)

GameInvitePromptClosed
Capabilities: Social
SocialService.GameInvitePromptClosed(
player:Instance, recipientIds:{any}
Parameters
player:Instance
recipientIds:{any}

PhoneBookPromptClosed
Capabilities: Social
SocialService.PhoneBookPromptClosed(player:Instance):RBXScriptSignal
Parameters
player:Instance

ShareSheetClosed
Capabilities: Social
SocialService.ShareSheetClosed(player:Player):RBXScriptSignal
Parameters
player:Player

Callbacks
OnCallInviteInvoked
Capabilities: Social
SocialService.OnCallInviteInvoked(
tag:string, callParticipantIds:{any}
Parameters
tag:string
callParticipantIds:{any}
Returns
Code Samples
SocialService.OnCallInviteInvoked
local SocialService = game:GetService("SocialService")
local TeleportService = game:GetService("TeleportService")
SocialService.OnCallInviteInvoked = function()
local placeId = 0123456789 -- This is the place ID of the desired place to drop call participants into
local accessCode = TeleportService:ReserveServerAsync(placeId)
return { ReservedServerAccessCode = accessCode, PlaceId = placeId }
end

©2026 Roblox Corporation. Roblox, the Roblox logo and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.