You can write your topic however you want, but you need to answer these questions:
-
Fix the script
-
Errors, code:
wait(1)
local TweenService = game:GetService("TweenService")
local trackdata = require(script.Parent.Track)
local Song = trackdata.Song
local Track = trackdata.Rythm
script.Sound.SoundId = "rbxassestid://"..Song
local StartTick = tick()
spawn(function()
repeat wait() until tick() - StartTick >= 5
script.Sound:Play()
end)
while true do
wait(.1)
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 = workspace.Game:FindFirstChild(v.."Start")
local Finish = workspace.Game: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 == "A" then
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angels(math.rad(90),0,0))
elseif v == "S" then
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angels(math.rad(180),0,0)
elseif v == "D" then
Key:SetPrimaryPartCFrame(Key.PrimaryPart.CFrame*CFrame.Angels(math.rad(-90),0,0)
end
for q,r in pairs(Key:GetChildren()) do
local Goal = {}
Goal.CFrame = r.CFrame*CFrame.new(Distance,0,0)
local tweeni = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.InOut)
local tween = TweenService:Create(r,tweeni,Goal)
tween:Play()
spawn(function()
wait(5)
local Goal = {}
Goal.Transparency = 1
local tweeni = TweenInfo.new(1)
local tween = TweenService:Create(r,tweeni,Goal)
tween:Play()
wait(1)
r.Parent:Destroy()
end)
end
end
end
end
The error:
- I tried looking on devforum.
I am currently making a game similar to RoBeats and the track script ain’t working. Anyone has any ideas? (Spent 30 minutes on trying to solve error)