Skip to content

Delta Framework

Delta Framework contains multiple useful variables and functions that can be used to ease development.
If you are looking for the home page, please click here.

There are two variants of the root script; DeltaServer and DeltaClient.

Each contain some variables, functions and libraries that are unique to their own, as one is for server scripts and the other for client scripts.


Variables

All variables below can be accessed through the DeltaFramework require and are shared between the client and the server unless labeled otherwise.

  • Workspace: Workspace service
  • Players: Players service
  • Lighting: Lighting service
  • ReplicatedStorage: ReplicatedStorage service
  • Marketplace: MarketplaceService service
  • ServerScriptService: ServerScriptService service (SERVER)
  • ServerStorage: ServerStorage service (SERVER)
  • DataStore: DataStoreService service (SERVER)
  • SoundService: SoundService service
  • MessagingService: MessagingService service (SERVER)
  • MemoryStoreService: MemoryStoreService service (SERVER)
  • TextService: TextService service (SERVER)
  • UIS: UserInputService service (CLIENT)
  • CAS: ContextActionService service (CLIENT)
  • VRService: VRService service (CLIENT)
  • GuiService: GuiService service (CLIENT)
  • StarterGui: StarterGui service (CLIENT)
  • ContentProvider: ContentProvider service (CLIENT)
  • TeleportService: TeleportService service
  • CS: CollectionService service
  • TweenService: TweenService service
  • RunService: RunService service
  • HttpService: HttpService service (SERVER)
  • Chat: Chat service (SERVER)
  • TextChatService: TextChatService service
  • Teams: Teams service
  • GroupService: GroupService service
  • BadgeService: BadgeService service
  • AnalyticsService: AnalyticsService service (SERVER)
  • ProximityPromptService: ProximityPromptService service (CLIENT)

  • Player: Players.LocalPlayer (CLIENT)
  • Mouse: Delta.Player:GetMouse() (CLIENT)
  • PlayerGui: Delta.Player.PlayerGui (CLIENT)
    Note that since a new Backpack is generated every time a player spawns in, Delta does not natively reference the Backpack as a variable.

  • EventPipeline: Internal cache for events assigned using Delta
  • Libraries: Internal cache for libraries and retrieved modules

Shared Functions

Event(Object | Instance/string, Event | string, Callback | function)

Creates an event connection if one does not already exist and adds the specified callback to the event pipeline. This can be useful when stacking multiple permanent and computationally light event connections by reducing the amount of connections.

By default, this function expects an Instance for the Object parameter. However, in the client, there are 5 special event connections you can use by typing their name in the Object parameter:
- RawCharacterAdded: Signaled as soon as the player's character spawns in
- CharacterAdded: Signaled as soon as the player's character has a Humanoid
- ChildAdded: Signaled when the player's character is parented a child
- ChildRemoved: Signaled when the player's character is removed a child
- Died: Signaled when the player's character dies

Delta:Event("CharacterAdded", function(Character)
    print("The local player has spawned in!")
end)

Clone(Module | ModuleScript)

Creates a copy of the module after required. Note that if the module returns a table, then Delta will be referenced in it through Required.Delta. (Required being the return of the require)


Client Functions

Device()

Returns Mobile, Console or Computer depending on the current input being used. Returns if the player is on Xbox as a second return value if they're playing on a console.

local Device, IsXbox = Delta:Device()

EnableUI(Enabled | bool: true)

Enables or disables all core UI and the ability to reset the character.


Libraries

Delta contains multiple libraries you can use to assist in multiple areas of scripting development. To access these, you use the Delta:Get(... | string) function.

Get(... | string)

Retrieves and returns the require of the specified ModuleScripts by name. This function will attempt to find the specified module in available locations (for example, ServerStorage is only a valid location in the server) and cache them for future use.
You can access the cache through Delta.Libraries.

You can retrieve all native libraries through this function.

local Utility = Delta:Get("Utility")

-- You can also retrieve multiple libraries in a variadic format
local Networking, Animations = Delta:Get("Networking", "Animations")


Optimizing large servers

DebugPlayers

If you find a need to optimize your backend to scale better and more performantly to large amounts of players, DeltaServer has a small but useful feature incorporated into it that simulates those kinds of conditions.
By replacing shared.Delta.Players = game:GetService('Players') with shared.Delta.Players = DebugPlayers, all code using Delta.Players will run as if they were being ran in a sandboxed version of the server, with custom amounts of players online.
Not all code will still work in this test scenario, but most code should be able to run so that you can experiment with different scenarios and improve performance that way.

The following code will generate a 100 player server for scripts to be stress tested on:

for i = 1, 100 do
    Delta.Players:Add("Player".. i, i) -- Name, UserId
end

Back to top