i have a loading system however it takes forever to load. is it posible to make this load data faster and more efficient like other games?
function Read2(value)
local tracks = game.CollectionService:GetTagged("Tracks")
if value:GetAttribute("Station") ~= script.Parent.Parent.station.Value then return end
for k=1, #tracks do local track = tracks[k]
if not track:IsDescendantOf(script.Parent.canvas) then continue end
if tostring(value:GetAttribute("AbsoluteKey")) ~= tostring(track:GetAttribute("AbsoluteKey")) then continue end
if value:GetAttribute("Owner") ~= player.Name then continue end
local NewNote = game.ReplicatedStorage.Sounds:FindFirstChild(value:GetAttribute("Instrument")):Clone()
local pos = value:GetAttribute("Position")
local len = value:GetAttribute("Size")
NewNote.Name = value.Name
NewNote.Position = pos
NewNote.Size = len
NewNote:SetAttribute("storesize",value:GetAttribute("Size"))
NewNote.assets.Velocity.Value = tonumber(value:GetAttribute("Velocity"))
NewNote.LeftScale.Velocityframe.Size = UDim2.new(math.clamp(NewNote.assets.Velocity.Value/16,0,8),0,NewNote.LeftScale.Velocityframe.Size.Y.Scale,0)
local notedescription = NewNote.RightScale.NoteDescription
notedescription.ImageLabel.Velocity.Text = tostring("Velocity: "..NewNote.assets.Velocity.Value)
NewNote.Parent = track
end
end
game.ReplicatedStorage.Remotes.Read3.OnClientEvent:Connect(function(plr)
loaded = false
local data = game.CollectionService:GetTagged(player.Name)
if player ~= plr then return end
script.Parent.Parent.processing.Visible = true
for k=1, #data do local value = data[k]
if value:GetAttribute("Station") ~= script.Parent.Parent.station.Value then continue end
coroutine.wrap(Read2)(value)
game["Run Service"].RenderStepped:Wait()
end
loaded = true
script.Parent.Parent.processing.Visible = false
game.ReplicatedStorage.Remotes.FinishLoading:FireServer(script.Parent.Parent.station.Value)
end)