Whenever you take out the sword you are meant to play the Idle animation which works, but one slight problem is that when you do take it out the animation is also being played over the default Roblox animation which is really annoying. Here is a screenshot of it.
As well as that when you unequip the sword, it still runs the script so if you move forward it will play the animation. Oh yea also if you press any button it runs the walking animation. Here is a screenshot for when it is unequipped.
First, i think that you doing it wrong, You need to put remote events depending on the skill your sword will do, then On a localscript, u can do
local uis = game:GetService("UserInputService")
local player = game:getService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:wait()
local event = tool.Skill1
uis.InputBegan:Connect(function(input)
if input.KeyCode == Enum.KeyCode.W or etc,etc,etc then
print("Skill used")
event:FireServer(argument1, argument2)
end)
then on a ServerScript
local event = tool.Skill1
event.OnServerEvent:Connect(function(player)
end)
And if you want to Stop ALL Animations of the player, you would do
for i, v in pairs(character:GetChildren()) do
if v:IsA("Animation") and not v.Name == "Idle" then
v:Stop()
end
end
and another way to detect movement Is
Player.Character.Humanoid.Running:connect(function(speed) --I hope player is a variable of an actual player.
if speed == 0 then --If they are not walking,
print(Player.Name.." has stopped walking.")
elseif speed > 0 then --If they started walking or is walking.
print(Player.Name.." is walking.")
end
end)
but thats not what im trying to do, its not skills its detecting when the player is moving because i dont know how to detect when the player is moving. and also im just trying to stop all the animations just for the sword and not the character
Player.Character.Humanoid.Running:connect(function(speed) --I hope player is a variable of an actual player.
if speed == 0 then --If they are not walking,
print(Player.Name.." has stopped walking.")
elseif speed > 0 then --If they started walking or is walking.
print(Player.Name.." is walking.")
end
end)
i mean it works but like the major problem is that yea it stops but then after that if i start moving it still plays the walking animation and as well as that if i just click any button my keyboard or click on my mouse it starts the walking animation and loops it forever