Getting Started

Interacting with services:

PhotonFramework offers a plethora of development services, from being able to calculate a projectile's estimated position after x amount of time to being able to create unique IDs for a given server.

In order to begin interacting with services, you need to use the PhotonFramework.Services table. This table contains two methods, GetService and CreateService.

Using GetService:

In order to use GetService, you need to supply a service name (as a string). Then, the method will return the service that you have requested.

Using CreateService:

CreateService allows you to create custom services within the framework, an example of using this is provided below:

local ServiceTable = {}
function ServiceTable:Initialize()
    print("Service initialized")
end
function ServiceTable:ping()
    print("pong")
end

PhotonFramework.Services:CreateService("CustomService",ServiceTable,false)

-- In a different script
local CustomService = PhotonFramework.Services:GetService("CustomService")
CustomService:ping() -- prints "pong"

The method takes three properties, the first one being the service name, the second one being the service data, and the third being BootState.

More expansive API:

If you would like to read over PhotonFramework's currently documented API, you can view all currently documented methods over on the Raw Documentation page.

Raw Documentation

Last updated