-
Inviting Friends and others with a TextButton inserted in a Part.
By clicking the Parts-TextButton it should open the Friend Invitation option. -
The Problem is it doesn’t work.
Maybe it has no way to open something in ScreenGui?
Or my script is doing something wrong.
Script:
local button = script.Parent
local SocialService = game:GetService("SocialService")
local player = game.Players.LocalPlayer
function onButtonPressed()
local success, result = pcall(function()
return SocialService:CanSendGameInviteAsync(player)
end)
if result == true then
SocialService:PromptGameInvite(player)
end
end
button.MouseButton1Click:Connect(onButtonPressed)
button.TouchTap:Connect(onButtonPressed)
- Nothing in kind has ever been made before, so that’s why I am here.