How would you achieve something like this?
1 Like
Hi, you can use PromptGameInvite() from Social Service
You can inivte a specific user like this:
local SocialService = game:GetService("SocialService")
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local receiverUserID = 000000000 --The ID of the person you want the player to invite.
-- Construct invite options with friend's user ID
local inviteOptions = Instance.new("ExperienceInviteOptions")
inviteOptions.InviteUser = receiverUserID
-- Function to check whether the player can send an invite
local function canSendGameInvite(sendingPlayer)
local success, canSend = pcall(function()
return SocialService:CanSendGameInviteAsync(sendingPlayer, receiverUserID)
end)
return success and canSend
end
local canInvite = canSendGameInvite(player)
if canInvite then
SocialService:PromptGameInvite(player, inviteOptions)
end
Here is a more detailed doc for that use: Player Invite Prompts | Documentation - Roblox Creator Hub
The GI will look like this:
You will also have to create a invite message string at create.roblox.com, the message the invited user will see.
1 Like