For some context the game is created by someone else and I uploaded the animations on my account
You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Fixing the sword animations -
What is the issue? Include screenshots / videos if possible!
Animations on a sword tool randomly flickering -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
- Re-uploading the animations
- I’ve seen posts about uploading it on the original owner of the game, but the animations still play so that must not be the issue
This Script is for the wood sword
repeat task.wait() until game.Players.LocalPlayer.Character.PrimaryPart
local plr = game.Players.LocalPlayer
local char = plr.Character
local hum = char.Humanoid
local hrp = char.HumanoidRootPart
local tool = script.Parent
local runservice = game:GetService("RunService")
local stoppedanimation = false
local stoppedwalk = false
local toolequipped = false
local uis = game:GetService("UserInputService")
local cooldown = false
--Animations--
local animationfolder = tool.Animations
local sliceanim = hum.Animator:LoadAnimation(animationfolder.Slice)
local idleanim = hum.Animator:LoadAnimation(animationfolder.Idle)
local walkanim = hum.Animator:LoadAnimation(animationfolder.Walk)
idleanim.Priority = Enum.AnimationPriority.Action3
walkanim.Priority = Enum.AnimationPriority.Action3
sliceanim.Priority = Enum.AnimationPriority.Action4
tool.Equipped:Connect(function()
toolequipped = true
if hum.MoveDirection.Magnitude == 0 then
idleanim:Play()
else
walkanim:Play()
end
end)
tool.Unequipped:Connect(function()
toolequipped = false
idleanim:Stop()
walkanim:Stop()
end)
uis.JumpRequest:Connect(function()
walkanim:Stop()
idleanim:Stop()
end)
hum.StateChanged:Connect(function(old,new)
if toolequipped then
if (new == Enum.HumanoidStateType.Landed)then
if hum.MoveDirection.Magnitude == 0 then
idleanim:Play()
else
walkanim:Play()
end
end
end
end)
runservice.Stepped:Connect(function()
if toolequipped then
if hum.MoveDirection.Magnitude > 0 then
stoppedanimation = true
idleanim:Stop()
else
if stoppedanimation then
wait()
idleanim:Play()
stoppedanimation = false
end
end
end
end)
runservice.Stepped:Connect(function()
if toolequipped then
if hum.MoveDirection.Magnitude == 0 then
walkanim:Stop()
stoppedwalk = true
else
if stoppedwalk then
walkanim:Play()
stoppedwalk = false
end
end
end
end)
tool.Activated:Connect(function()
if not cooldown then
cooldown = true
sliceanim:Play()
game.ReplicatedStorage.RemoteEvents.Sword.SlashHitbox:FireServer()
game.ReplicatedStorage.RemoteEvents.Sword.SlashEffect:FireServer(tool.Parts.VFXPart)
wait(sliceanim.Length)
cooldown = false
end
end)
The yoru sword has all the scripts for playing walking and idle animations commented
https://gyazo.com/04bfa4c5a661aa2b68de4589e3d23123
https://gyazo.com/3f87c7461f86d19e1e24d012a7579f75
This bug started like a couple of days ago