Problem with animation: https://gyazo.com/9a545dd2e13f8e2054e24cadbbb9bf1a
I made an animation that plays whenever the player runs while wielding the sword with the script below. It kind of works -- as seen by the link above -- however it gets cut off a lot. I've tried some different things such as:
-- Changing the priority(I tried every single one)
-- Disabling the "Animate" Script in the character
-- Changing the duration of the animation
-- Using a remote function(As seen in my current script)
-- Reading the Wikia
What else can I do? I was thinking of replacing the default Roblox run animation when the weapon is equipped but I read on the Wikia that it doesn't work anymore.
Server script inside sword(Part of the script):
local repStorage = game:GetService("ReplicatedStorage") function Equipped() Character = Tool.Parent Player = Players:GetPlayerFromCharacter(Character) Humanoid = Character:FindFirstChild("Humanoid") RootPart = Character:FindFirstChild("HumanoidRootPart") if not CheckIfAlive() then return end ToolEquipped = true Humanoid.Running:Connect(function() local a = repStorage:WaitForChild("PlayAnim") a:FireServer() end) end Tool.Equipped:connect(Equipped)
Server Script in ServerScriptService:
local repStorage = game:GetService("ReplicatedStorage") local remote = repStorage:WaitForChild("PlayAnim") --//Remote Event//-- remote.OnServerEvent:Connect(function(player) local run = player.Character.Humanoid:LoadAnimation(game.ReplicatedStorage.Anim.SwordRun) run:Play() end)
Okay so the Humanoid.Running
event gets fired every time the player starts to run or stop try it out to see what happens add a print
inside the Humanoid.Running
event.What I suggest you do is try to replace the run anim and walk with your animation it is in side the character.Animate.walk
but also change the run
Read more on Humanoid.Running
https://wiki.roblox.com/index.php?title=API:Class/Humanoid/Running