local function O(O)local w,V=pcall(function()return SocialService:CanSendGameInviteAsync(O)end)return w and V end button.Activated:Connect(function()local w=O(player)if w then local O,w=pcall(function()SocialService:PromptGameInvite(player)end)end end)
-- 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

button.Activated:Connect(function()
	local canInvite = canSendGameInvite(player)
	if canInvite then
		local success, errorMessage = pcall(function()
			SocialService:PromptGameInvite(player)
		end)
	end
end)
