Let me explain real quick: I want to change the PlaybackSpeed of the running (footstep) sound when the player starts running. However, the sound isn’t recognized by the running script (since I want everyone to hear the sound change), but it works in the LocalScript.
My running script inside the global script:
rp.Events.Run.OnServerEvent:Connect(function(player,action)
local char = player.Character
local hum = char.Humanoid
local sound = char.HumanoidRootPart.Running
local soundTween = TweenInfo.new(1, Enum.EasingStyle.Sine,Enum.EasingDirection.In,0,false,0)
local tweenSound = ts:Create(sound,soundTween,{PlaybackSpeed = 1.5})
if action == "Run" then
tweenSound:Play()
hum.WalkSpeed = 8
hum.JumpPower = 105
repeat
speeding = true
hum.WalkSpeed = hum.WalkSpeed + 1
wait(0.02)
until hum.WalkSpeed == 60 + char.Stats.SpeedBoost.Value or speeding == false
end
end)
You can see that the sound is there. The error: