Changing custom animations. Why won't this work?
So I was browsing around and I found a cool script that changes the default roblox animations such as the /e dance emotes, running & more. It works perfectly but I have a sprinting script and when I hold LShift I want it to change my animation. However the walking animation stays the same every time. I Hold shift. Though running still works. Here is my code. Can you tell me why nothing changes?
01 | local mouse = game.Players.LocalPlayer:GetMouse() |
05 | for _, kid in ipairs (script.Parent:GetChildren()) do |
06 | if kid.className = = "Tool" then return kid end |
12 | mouse.KeyDown:connect( function (key) |
13 | key = string.lower(key) |
14 | if string.byte(key) = = 48 then |
16 | local keyConnection = mouse.KeyUp:connect( function (key) |
17 | if string.byte(key) = = 48 then |
22 | game.Workspace.CurrentCamera.FieldOfView = ( 70 +(i* 2 )) |
25 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 25 |
28 | repeat wait () until running = = false |
29 | keyConnection:disconnect() |
32 | game.Players.LocalPlayer.Character.Humanoid.WalkSpeed = 8 |
34 | game.Workspace.CurrentCamera.FieldOfView = ( 80 -(i* 2 )) |