first of all, put this in #help-and-feedback:scripting-support, and second;
I’m not entirely sure how FNFs system works, but there is a MUCH easier system you can use, which many other rhythm games use, including one I was recreating.
(plus, from what I’ve heard FNFs system just sucks)
So first, you create a string of “map data”
How you write this is entirely up to you, I use a system like this: 0|0|0.993,0|1|1.293,2|0|1.875
Then, in code, you split the string.
local MapData = string.split(script.DataToRead.Value, ',')
table.remove(MapData, 1)
-- MapData1 is removed because that stores the AudioId in my system
Then, I run a function for each note in the map. There’s definitely better ways to do this, this is just how I did mine last year.
for Index, Value in pairs(MapData) do
local NoteData = string.split(Value, '|')
CreateNote(NoteData)
end
function CreateNote(NoteData)
NoteColor += 1
if not NoteColors[NoteColor] then NoteColor = 1 end
local Note = script:WaitForChild("Note"):Clone()
Note.Color = NoteColors[NoteColor]
Note.Box.Color3 = NoteColors[NoteColor]
local NoteX = 1.8 - (1.8 * tonumber(NoteData[1]))
local NoteY = -1.8 + (1.8 * tonumber(NoteData[2]))
table.insert(LoadedNotes, {["Note"] = Note; ["SpawnTime"] = NoteData[3]/1000})
NoteData = nil
Note.Position = Vector3.new(NoteX, NoteY, -0.042-ApproachDistance)
Note.Parent = workspace.Notes
end
As for managing when the notes spawn, I don’t remember exactly what I did, but it works, and the code is here:
if LoadedNotes[1].SpawnTime < ApproachTime and script.OffsetMapMusic.TimePosition - script.MapMusic.TimePosition >= LoadedNotes[1].SpawnTime or LoadedNotes[1].SpawnTime >= ApproachTime and script.OffsetMapMusic.TimePosition >= LoadedNotes[1].SpawnTime then
task.spawn(function() SpawnNote(LoadedNotes[1].Note, #LoadedNotes) end)
table.remove(LoadedNotes, 1)
end
Then, from there I just have another function to process the notes getting hit, and the result works.
(epilepsy warning I guess)
Although, with your code, I’d imagine the issue would be in the BPM math. Again, I have zero idea how FNFs system works, I just know its bad mainly because of how it processes notes.
My understanding of BPM in charting is that its only used for creating charts, not loading them.
You could try altering your system to just use a spawn time similar to how mine does, and that should fix the issue, although you would have to rewrite all the map data to do so.