Hello, I am making a Rhythm game and when I coded the notes the intentions were to approach quick and in a large group not one at a time, which they did. I tried my best to combat this, but no results. Please help me.
wait(1)
local TweenService = game:GetService("TweenService")
local TrackData = require(script.Parent.Rythm)
local Song = TrackData.Song
local Speed = TrackData.AppTime
local Track = TrackData.Rythm
local function Destroy(r)
wait(.3)
r.Parent:Destroy()
end
local function Tween(Key,Distance)
for q,r in pairs(Key:GetChildren()) do
local Goal = {}
wait()
Goal.CFrame = r.CFrame*CFrame.new(Distance,0,0)
local Tweeni = TweenInfo.new(.3,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut)
local tween = TweenService:Create(r,Tweeni,Goal)
tween:Play()
Destroy(r)
end
end
script.Sound.SoundId = "rbxassetid://"..Song
local StartTick = tick()
spawn(function()
repeat wait() until tick() - StartTick >= 5
script.Sound:Play()
end)
while true do
wait()
local Second = tick() - StartTick
Second = Second * 10
Second = math.floor(Second)
Second = Second / 10
for i,v in pairs(Track) do
if i == Second then
local Start = game.Workspace.Notes:FindFirstChild(v.."Note")
local Finish = game.Workspace.Notes:FindFirstChild(v.."Finish")
if Start and Finish then
local Key = game.ReplicatedStorage.Key:Clone()
Key.Parent = workspace
Key:SetPrimaryPartCFrame(Start.CFrame)
local Distance = (Start.Position-Finish.Position).magnitude
if v == "Left" then
Key.LeftFinish.BrickColor = BrickColor.Red()
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angles(math.rad(180),0,0))
end
if v == "Center" then
Key.LeftFinish.BrickColor = BrickColor.new("Really blue")
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angles(math.rad(180),0,0))
end
if v == "Right" then
Key.LeftFinish.BrickColor = BrickColor.new("New Yeller")
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angles(math.rad(180),0,0))
end
wait()
Tween(Key,Distance)
end
end
end
end

1 comment
FYI The map I am mapping is: Jauz x San Holo - OK!