This is a local script in Starter Character Scripts
local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer local humanoid = localPlayer.Character:WaitForChild("Humanoid", 1) local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://6793653980" animation.Parent = humanoid loadedAnimation = humanoid.Animator:LoadAnimation(animation) UserInputService.InputBegan:Connect(function(input, gameProccesed) if gameProccesed then return else if input.KeyCode == Enum.KeyCode.LeftShift then humanoid.WalkSpeed = 25 loadedAnimation:Play() end end end) UserInputService.InputEnded:Connect(function(input, gameProccesed) if gameProccesed then return else if input.KeyCode == Enum.KeyCode.LeftShift then humanoid.WalkSpeed = 16 loadedAnimation:Stop() end end end)
I don't understand why this is happening, I have made it so the server runs it, same problem, I'm thinking it's because the walk animation is overwriting it. I tried fixing it, no luck. Need help!
(THIS IS NOT MY SCRIPT, I MUST SAY, I HAVE EDITED IT HOWEVER.)
Update: I found out that it is only happening on my side, I could see my alt running however it didn't show me running on the alt side. Fixes? Also, updated script.
Update2: Randomly fixed itself. If you can please close the thread/question
Many thanks, Narwhal
either you play the game
press left shift
swap to the server side expecting the client to still run trying to see if animation is playing on the server
the character animation swapped to idle because input has ended and input has ended because you swapped to server side of things
thats the only way i could think of that you think the animation isnt playing and that would be a YOU problem
or if it is true that it isnt your problem then my only solution would be to set ownership maually or use a remote event in the code below
--local script local UserInputService = game:GetService("UserInputService") local Players = game:GetService("Players") local localPlayer = Players.LocalPlayer UserInputService.InputBegan:Connect(function(input) --im telling you that you really only ever need input --you really dont need gameprocessedevent if input.KeyCode == Enum.KeyCode.LeftShift then humanoid = localPlayer.Character:WaitForChild("Humanoid") humanoid.WalkSpeed = 25 local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent RemoteEvent:FireServer() end end) UserInputService.InputEnded:Connect(function(input, gameProccesed) if input.KeyCode == Enum.KeyCode.LeftShift then humanoid.WalkSpeed = 16 loadedAnimation:Stop() end end)
server script
local RemoteEvent = game:GetService("ReplicatedStorage").RemoteEvent RemoteEvent.OnServerEvent:Connect(function() local animation = Instance.new("Animation") animation.AnimationId = "rbxassetid://6793653980" animation.Parent = humanoid loadedAnimation = humanoid:LoadAnimation(animation) loadedAnimation:Play() end)