I got my code from roblox docs and it only displays the actual gui where you invite people. The problem is it doesn’t invite people on roblox and send them game link.
I looked online for solutions none worked.
-- This is an example Lua code block
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
local success, errorMessage = pcall(function()
SocialService:PromptGameInvite(player)
end)
end
How can i get it to actually send the invite prompt to the player being invited? I thought this code would work from roblox’s docs.