/Knit

Game framework for Roblox (Alpha)

Primary LanguageLuaMIT LicenseMIT

Release Lint Deploy Docs

Knit

Knit is a lightweight framework for Roblox that simplifies communication between core parts of your game and seamlessly bridges the gap between the server and the client.

Read the documentation for more info.

Check out the Knit video tutorials for hands-on examples.


Alpha

Knit is still in alpha, but will soon be elevated to beta. See the Beta Roadmap for more info. Please be aware that breaking changes may still be introduced.


Example

Here is a simple and fully-working example where a PointsService is created server-side and lets the client access points from the service. No RemoteFunctions or RemoteEvents have to be made; those are handled internally by Knit.

Server:

local Knit = require(game:GetService("ReplicatedStorage").Knit)

-- Create a PointsService:
local PointsService = Knit.CreateService {
	Name = "PointsService";
	Client = {};
}

-- Expose an endpoint that the client can invoke:
function PointsService.Client:GetPoints(player)
	return 10
end

Knit.Start()

Client:

local Knit = require(game:GetService("ReplicatedStorage").Knit)

local MyController = Knit.CreateController {
	Name = "MyController";
}

function MyController:KnitStart()
	-- Fetch points from the server-side PointsService:
	local PointsService = Knit.GetService("PointsService")
	local points = PointsService:GetPoints()
	print("Points", points)
end

Knit.Start()