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)

3 comments
Is the animation looped?
@magicguy78942 I couldn't find a "loop" button on the new Roblox Animation UI
I found an animation plugin with the "loop" option. This is what happened after the loop: https://gyazo.com/cf085f86799915e1e222a8e0e87e0e28