so this is my script of /e customanimation
setupCheck = game.ServerStorage:findFirstChild("Animations") if setupCheck == nil then error(script.Name .. " hasn't been setup!", 0) end -- Yes I really just did that
anims = game.ServerStorage.Animations:GetChildren()
game.Players.PlayerAdded:connect(function(player) function playAnimation(name) for i, anim in ipairs(anims) do if anim.Name:lower() == name:lower() then local b = player.Character.Humanoid:LoadAnimation(anim) b:Play() print(player.Name .. " played animation: " .. anim.Name) end end end
player.Chatted:connect(function(message) if message:sub(1, 3) == "/e " then local a = playAnimation(message:sub(4)) end end)
end)
and i want it so that if you press shift to run it plays and when you stop running it stops playing
can someone help me or send me a script
Using user input service is a good idea for a script like this then getting the tick() time fi you want to let them have a certian time limit before they arn't able to run again if they use it all up but to play an animation you need to make a animation then load it into the humanoids character like this
local animation=script.Parent.Animation local plyr=game.Players.LocalPlayer function LoadAnimation(anim) plyr.Character.Humanoid:LoadAnimation(anim) end function PlayAnimation(animtrack) animtrack:Play() end function StopAnimation(animtrack) animtrack:Stop() end
for more advance documentation I would look at the api on animationtracks which are loaded when you use the load animation function on humanoids here