It seems like the Line runs only once because it sets the Rotation of the HumanoidRootPart of the character to a fixed value (0, 180, 0) every time the event is triggered. After it’s set once, it subsequent attempts to set it to the same value won’t have any noticeable effect visually.
Might be wrong, but I think thats the case here
thank you @Sentlyee and @emiliotigre2017 for the help!, however i managed to fix the problem myself with an if statement, which is a kinda dum solution but it works:
local r = true -- Changed
game.ReplicatedStorage.ControlActions.RunBackAnimFor_S_Key.OnServerEvent:Connect(function(player)
local humanoid = player.Character.Humanoid
local anim = humanoid:LoadAnimation(game.Lighting.RUNBACK_ANIM)
humanoid.WalkSpeed = 0
humanoid.JumpPower = 0
anim:Play()
wait(anim.Length)
humanoid.WalkSpeed = 16
if r then -- Changed
player.Character.HumanoidRootPart.Rotation = Vector3.new(0, 180 , 0)
end
end)
game.ReplicatedStorage.ControlActions.RunBackAnimFor_A_Key.OnServerEvent:Connect(function(player)
local anim = player.Character.Humanoid:LoadAnimation(game.Lighting.test)
anim:Play()
end)