I have a script where it removes a previous script and replaces it with a new one but I can't figure out how to make it so the new one saves after resetting.
Here is the script:
local re = game.ReplicatedStorage.Green
re.OnServerEvent:Connect(function(player)
for i, v in pairs(game.Players:GetChildren()) do
v.Backpack.BeatSyncs:ClearAllChildren()
end
wait(0.1)
for i, v in pairs(game.Players:GetChildren()) do
local clubcolor= game.ServerStorage.BeatSyncClientGreen:Clone()
clubcolor.Parent = v.Backpack.BeatSyncs
end
end)

1 comment
"repeat wait() until character.Humanoid" really? This will still error if the humanoid doesn't exist, and don't reinvent the wheel, just use :WaitForChild(), and :connect is deprecated infavour of :Connect