I'm trying to make a running script but other players can't see my animation
local p = game.Players.LocalPlayer
local char = p.Character
if not p.Character then
repeat wait() until p.Character
end
local human = char.Humanoid
local anim = game.Workspace:WaitForChild("Animation")
local loadAnim = human:LoadAnimation(anim)
local UIS = game:GetService("UserInputService")
local holdingShiftKey = false
UIS.InputBegan:Connect(function(inputObject)
if(inputObject.KeyCode==Enum.KeyCode.E)then
holdingShiftKey = true
if holdingShiftKey then
loadAnim:Play()
repeat wait(.5)
char.Humanoid.WalkSpeed += 1
until char.Humanoid.WalkSpeed == 25 or not holdingShiftKey
end
end
end)
UIS.InputEnded:Connect(function(inputObject)
if(inputObject.KeyCode==Enum.KeyCode.E)then
holdingShiftKey = false
char.Humanoid.WalkSpeed = 16
loadAnim:Stop()
end
end)
Does anyone have a fix for this?

2 comments
But where do I put it for it to do this? Or do I do "Anim.Parent = char"
Nvm I got it to work