I've changed my code but it still doesn't work?
script.Parent.OnServerEvent:connect(function(Player, Action, V1) local c = Player.Character or Player.CharacterAdded:Wait() if Action == "Release" then ButtonDown = false end if Enabled == false then return end if Action == "Combat" then Enabled = false local Humanoid = c:WaitForChild("Humanoid") local Animator = Humanoid:WaitForChild("Animator") if Combo == 1 then Combo = 2 local Track = Instance.new("Animation") Track.AnimationId = "rbxassetid://11285688290" local Anim = Animator:LoadAnimation(Track) Anim:Play() wait(0.5)
Enabled = true ButtonDown = false Combo = 1 script.Parent.OnServerEvent:connect(function(Player, Action, V1) local c = Player.Character or Player.CharacterAdded:Wait() if Action == "Release" then ButtonDown = false end if Enabled == false then return end if Action == "Combat" then Enabled = false if Combo == 1 then Combo = 2 local Track = Instance.new("Animation") Track.AnimationId = "rbxassetid://11285688290" local Anim = c.Humanoid:LoadAnimation(Track) Anim:Play() wait(0.5) elseif Combo == 2 then Combo = 3 local Track = Instance.new("Animation") Track.AnimationId = "rbxassetid://11285688290" local Anim = c.Humanoid:LoadAnimation(Track) Anim:Play() wait(0.5) elseif Combo == 3 then Combo = 1 local Track = Instance.new("Animation") Track.AnimationId = "rbxassetid://11285688290" local Anim = c.Humanoid:LoadAnimation(Track) Anim:Play() wait(0.5) end end wait(0.09) local Region = Region3.new(V1-Vector3.new(3,3,3),V1+Vector3.new(3,3,3)) local RTable = workspace:FindPartsInRegion3(Region, nil, 20) for i,v in pairs(RTable) do if v.Parent:findFirstChild("Humanoid") and v.Parent:findFirstChild("Deb") == nil and v.Parent ~= c then local Deb = Instance.new("BoolValue", v.Parent) Deb.Name = "Deb" game.Debris:AddItem(Deb,0,2) v.Parent.Humanoid:TakeDamage(5) local S = Instance.new("Sound", v) S.SoundId = "rbxassetid://11285764868" S.PlaybackSpeed = math.random(80,120)/100 S:Play() end Enabled = true end end)
Humanoid:LoadAnimation
does not work anymore. Use a "Animator" Instead
What prints in the console?
Maybe try giving a parent to the animation?
Edit: Ok so are you sure the "Play()" line is being ran through? you can do "print("Playing") right above the "Play()" line to see if it is, if "Playing" doesn't print that means the Action isn't working properly.
Otherwise I'm not sure what could be the issue, as in my case, I make the animations before, and I place them in a folder inside a tool, so i can use them, here is an example of my code for a knife weapon:
function ActionManager() if playingIdle == true then if Attacking == false then Attacking = true --- Combo String if ComboNum == 0 then ComboNum = 1 Slash1() elseif ComboNum == 1 then ComboNum = 0 Slash2() end wait(0.2) Attacking = false end end end knife.Activated:Connect(ActionManager) local Anim_Slash1 = knife.Handle.Animations.Slash1 local Slash1Anim = holderChar.Humanoid:LoadAnimation(Anim_Slash1) function Slash1() Slash1Anim:Play() wait(0.16) local SlashSounds = SoundsFolder.SlashSounds:GetChildren() local randomSlash = SlashSounds[math.random(1, #SlashSounds)] randomSlash:Play() end
Maybe you can try making the animations beforehand like i did with my code? If that doesn't work I have no idea what could be the issue
Hello! I am currently working on a solution (which I'm sure I almost have figured out) and will be updated ASAP.