First, I know there’s a lot of loops here. However, my issue is within one of them where it takes descendant.Name == “Running” then to change the playbackspeed. There are no errors and the sound is placed within the humanoidrootpart and the potiondrinking sound plays fine. I’m not sure what’s the issue here. Essentially I’m trying to make the playback speed match with the character speed.
local events = game.ReplicatedStorage.Events
local speed = events.LiquidSpeed
speed.OnServerEvent:Connect(
function(player)
print(player.Name .. " is drinking Liquid Speed.")
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "PotionDrinking" then
descendant:Play()
end
end
wait(1.5)
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "Handle" then
descendant:Destroy()
end
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "Humanoid" then
descendant.WalkSpeed = 24
end
end
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "Running" then
descendant.PlaybackSpeed = 2.775
end
end
end
wait(15)
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "Humanoid" then
descendant.WalkSpeed = 16
end
end
for i, descendant in ipairs(player.Character:GetDescendants()) do
if descendant.Name == "Running" then
descendant.PlaybackSpeed = 1.85
end
end
end
)
Note: The rest of the code works fine, but the PlaybackSpeed is the only property that wont change.