Hey, I’m trying to make a sword system using roblox’s default sword animation, (of course i only changed the animation id) but a weird thing happened, whenever i slash my sword like 2-3 times fast, the arms would go down, any ideas?
Edit: Debounce doesn’t help at all
if debounce == false then
local str = Instance.new("StringValue")
str.Name = "toolanim"
str.Value = "Slash"
str.Parent = tool
debounce = true
wait(1.5)
debounce = false
else
wait(1.5)
debounce = false
end
end
if isEquipped == "Equip" then
tool = swordDictionary[1]:Clone()
tool.Parent = char
equippedSwords[plr.Name] = tool.Name
hum:EquipTool(tool)
tool.Activated:Connect(slash)
local Players = game:GetService("Players")
local localPlayer = Players.LocalPlayer
if not localPlayer.Character then
localPlayer.CharacterAdded:Wait()
end
local humanoid = localPlayer.Character:WaitForChild("Humanoid")
local AnimationTracks = humanoid:GetPlayingAnimationTracks()
for i, track in pairs (AnimationTracks) do
track:Stop()
end
I’m not sure if humanoid:GetPlayingAnimationTracks is deprecated, but if it is simply use humanoid.Animator
I Think my problem was i was relying on the roblox animation script way too much, i also did it in a server script, i will write my own animation script from scratch in a local script