-
-
Notifications
You must be signed in to change notification settings - Fork 99
ServiceName must be a string; got table #228
Comments
You don't have to require the signal module to create a signal. You can create a signal directly by doing local Knit = require(game:GetService("ReplicatedStorage"):WaitForChild("Packages").Knit)
local MusicService = Knit.CreateService {
Name = "MusicService",
Client = {
SoundtrackUpdate = knit.CreateSignal();
}
} |
Still has the same issue, ServiceName must be a string; got table |
At the end of the module are you returning MusicService? return MusicService |
Yes i am. |
Are you able to post the module script here? Also, instead of doing close with comment, you can just do a normal comment and then close this issue when it's fixed. |
Sorry, I accidentally keep clicking the wrong button. Anyways here is my code. ` local MusicService = Knit.CreateService { function MusicService:KnitInit() function MusicService:KnitStart() -- code -- function MusicService:ServerPlaySoundtrack(soundTrackObject: Sound) function MusicService.Client:GetCurrentPlayingTrack() function MusicService:SetTrackPosition(soundTrackObject: Sound) return MusicService |
You cannot describe functions inside the client table. Instead of doing function MusicService.Client:GetCurrentPlayingTrack()
local currentSoundtrack = self.CurrentSoundtrack
return currentSoundtrack
end You could instead, create a remote property for the current soundtrack and use the following documentation. https://sleitnick.github.io/Knit/docs/services#properties (Also, you can embed code on Github by enclosing your code inside ```lua and closing it with another set of ```) |
Hey, if you haven't solved this yet, I was able to reproduce the error with You might possibly be using |
Followed the tutorial on the docs and YouTube video followed it thoroughly, not sure whats happening here but every time I call the service I get this error.
ServiceName must be a string; got table
I'm not sure what really could be causing this,
`local Knit = require(game.ReplicatedStorage.Packages.Knit)
local Signal = require(Knit.Util.Signal)
local MusicService = Knit.CreateService {
Name = "MusicService",
Client = {SoundtrackUpdate = Signal.new()},
}
`
The text was updated successfully, but these errors were encountered: