Hey okay so basically I’m currently making a game using the Knit game framework, and I’m having some issues with using services in other services, for example:
Service 1:
local replicatedStorage = game:GetService("ReplicatedStorage")
local serverScriptService = game:GetService("ServerScriptService")
local serverStorage = game:GetService("ServerStorage")
local players = game:GetService("Players")
local packages = replicatedStorage:FindFirstChild("Packages")
local knit = require(packages:FindFirstChild("Knit"))
local profileService = require(serverStorage:FindFirstChild("ProfileService"))
local dataService = knit.CreateService {
Name = "DataService",
Client = {},
_profiles = {}
}
Service 2:
local replicatedStorage = game:GetService("ReplicatedStorage")
local serverScriptService = game:GetService("ServerScriptService")
local serverStorage = game:GetService("ServerStorage")
local players = game:GetService("Players")
local packages = replicatedStorage:FindFirstChild("Packages")
local knit = require(packages:FindFirstChild("Knit"))
!! local dataService = knit.GetService("DataService")
local dataController = knit.CreateService {
Name = "DataController",
Client = {
killsChanged = knit.CreateSignal();
winsChanged = knit.CreateSignal();
balanceChanged = knit.CreateSignal();
},
}
Service 2 always fails to load, errors on the line prefixed with "!! ".
The error is that you can’t get a service until Knit has started, however Knit can’t start until all of the Services are loaded. It’s like a loop
I know it must be possible to do this, just don’t know how.
Thanks