Overview
The SkyTeam ROBLOX module allows alliance member airlines to integrate the SkyTeam system directly into their ROBLOX games. The module handles API communication, player authentication, and real-time UI updates.Module Architecture
The module is built in TypeScript using roblox-ts:apps/models/src/module/index.ts
Server-Side Module
The module runs on the server and manages client-server communication via RemoteEvents.
Initialization
The module initializes when the game starts:apps/models/src/module/index.ts
Service Validation
The module tests if required services are available:apps/models/src/module/index.ts
HttpService Required
The module requires HttpService to be enabled in game settings for API communication.
Error Handling
The module broadcasts errors to all clients:apps/models/src/module/index.ts
apps/models/src/module/client/ErrorMessage.tsx
Client Integration
The client-side code connects to the RemoteEvent:apps/models/src/module/client/index.client.tsx
Communication Types
The module uses typed events for communication:apps/models/src/module/shared/CommunicationTypes.d.ts
Type Safety
TypeScript ensures type-safe communication between server and clients.
Example Implementation
Here’s how to use the module in your game:apps/models/src/loader/main.server.ts
Configuration
TOKEN
Your airline’s API authentication token
Flags
Optional feature flags for the module
API Communication
The module communicates with the SkyTeam API:Production API
In production, this should point to
https://api.skyteam.devModule Structure
Features
Auto-Setup
Automatically initializes for all players, including mid-game joins
Error Reporting
Clear error messages when initialization fails
Type Safety
TypeScript ensures correct usage at compile-time
Client-Server Sync
RemoteEvents keep clients in sync with server state
Requirements
Best Practices
Secure Tokens
Keep your API token secure and never expose it in client-side code
Handle Errors
Always check for initialization errors and display them to players
Test Locally
Use the local API endpoint during development
Monitor Players
Track player joins and ensure they receive the client script
Troubleshooting
HttpService Not Enabled
If you see “HttpService is not allowed” errors:- Go to Game Settings in ROBLOX Studio
- Navigate to Security
- Enable “Allow HTTP Requests”
- Restart your game
Client Script Not Loading
If players don’t see the UI:- Check that the client script exists in the module
- Verify it’s being cloned to PlayerGui
- Look for errors in the Output window
API Connection Failed
If the module can’t connect to the API:- Verify your API token is correct
- Check that the API endpoint is accessible
- Ensure HttpService is enabled
Next Steps
API Authentication
Learn how to authenticate API requests from your ROBLOX game