#idk why but my m1 animation stops working
1 messages · Page 1 of 1 (latest)
start by loading all your animations beforehand
local animator = Char.Humanoid:WaitForChild("Animator")
local animations = script.Parent.Animations
local anim1 = animations.A1
local anim2 = animations.A2
local anim3 = animations.A3
local anim4 = animations.A4
local anim5 = animations.A5
alternatively you could add all the tracks to a table and have it loop and load
local animator = Char.Humanoid:WaitForChild("Animator")
local animations = script.Parent.Animations:GetChildren()
local anims = {}
for _,i in animations do
local value = animator:LoadAnimation(i)
table.insert(anims,value)
end
and then in the combos code just index instead of checking every single time
if action == "ComboUpdate" then
Combo.Value += 1
anims[Combo.Value]:Play()
game.Debris:AddItem(animation,2)
end
also to make sure this works after respawning, put it in a .CharacterAdded event listener
local plr = game.Players.LocalPlayer
local animator, animations, anims
plr.CharacterAdded:Connect(function(Char)
animator = Char.Humanoid:WaitForChild("Animator")
animations = script.Parent.Animations:GetChildren()
anims = {}
for _,i in animations do
local value = animator:LoadAnimation(i)
table.insert(anims,value)
end
end)
that is a load of else if statements
i'll say that
@glad pasture still didnt fix the problem
Also when i changed it to this which works with another fist m1 combat i made and it still breaks also it doesnt work when i punch someone
** You are now Level 1! **
the problem is that when another player joins, the animations stop working?
yeah they like bug out
this is in a localscript?
nope
that's your problem
always handle animations on the client
otherwise it's just adding strain on the server
and if you're worried about exploits, animations are always very exploitable