I have a local script that I am trying to switch to a server script so everyone in the game can see it, not just the person that has it. This seems to be the only problem of the script that isn't working. I am trying to figure out what I need to change for it to work. (loudness is for playbackloudness, the parts are bouncing with the beat basically)
Server Script:
game:GetService("RunService").Heartbeat:connect(function()
for i, v in pairs(game.Players:GetChildren()) do
for i = 1, #Parts do
if i == 1 then
Parts[i].CFrame = Parts[i].CFrame:lerp(v.Character.UpperTorso.CFrame, 0.9)
else
Parts[i].CFrame = Parts[i].CFrame:lerp(Parts[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(-loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
end
end
end
for i, v in pairs(game.Players:GetChildren()) do
for i = 1, #Parts2 do
if i == 1 then
Parts2[i].CFrame = Parts2[i].CFrame:lerp(v.Character.UpperTorso.CFrame, 0.9)
else
Parts2[i].CFrame = Parts2[i].CFrame:lerp(Parts2[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
end
end
end
end)
Here's the same part but from the Local Script i'm changing it from:
game:GetService("RunService").RenderStepped:connect(function()
for i = 1, #Parts do
if i == 1 then
Parts[i].CFrame = Parts[i].CFrame:lerp(game.Players.LocalPlayer.Character.UpperTorso.CFrame, 0.9)
else
Parts[i].CFrame = Parts[i].CFrame:lerp(Parts[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(-loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
end
end
for i = 1, #Parts2 do
if i == 1 then
Parts2[i].CFrame = Parts2[i].CFrame:lerp(game.Players.LocalPlayer.Character.UpperTorso.CFrame, 0.9)
else
Parts2[i].CFrame = Parts2[i].CFrame:lerp(Parts2[i - 1].CFrame * CFrame.Angles(-loudness / 20, math.sin(loudness / 50), 0) * CFrame.new(0, 0, 0.15), 0.8)
end
end
end)

2 comments
When you write an answer it literally says "If you are not posting an explanation, please use comments instead!"
This is might be the answer