How to make ANIMATIONS for a TOOL in ROBLOX STUDIO!

แชร์
ฝัง
  • เผยแพร่เมื่อ 4 ต.ค. 2024
  • How to make an Idle and Walk animation for a Tool in Roblox Studio
    This is a tutorial about making animations for tools in Roblox Studio. Make sure to subscribe, leave a like and comment!
    Thanks so much for watching!
    roblox particle,roblox tutorials,lighting tutorials,roblox studio,roblox plugin,roblox anime vfx,modeling tutorials,building tutorials,lighting,particles,particle tutorials,particle emitter,lights,modeling,building,roblox vfx,vfx tutorials,light,roblox,studio,tutorials,gaming,builds,models,blender,tutorial,build,games,model,plugins,help,game
  • เกม

ความคิดเห็น • 109

  • @SnakesRobbs
    @SnakesRobbs  10 หลายเดือนก่อน +7

    I forgot to add, if you want the animation to stop playing when you jump, just add a line into the while loop in the server script “if humanoid.Jump == true then” and then stop the idle animation and the walk animation.

    • @cool_blox3877
      @cool_blox3877 9 หลายเดือนก่อน +2

      can you open source it?

    • @Varli7
      @Varli7 5 หลายเดือนก่อน

      it didnt work

    • @Enigmatic-v83
      @Enigmatic-v83 5 หลายเดือนก่อน

      @@cool_blox3877bro just make your own tool and do it i did it and it worked and it was fun

    • @exyft
      @exyft 5 หลายเดือนก่อน

      which line?

    • @flamingballz
      @flamingballz 3 หลายเดือนก่อน

      bro i love u, i would kiss you if i could ty ty

  • @exyft
    @exyft 5 หลายเดือนก่อน +13

    Script:
    script.Parent.Equipped:Connect (function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    local equipped = true
    local idleanim = humanoid:LoadAnimation(script.Idle)
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.Walk)

    local idle = true
    local walking = false

    coroutine.wrap(function()
    while wait() do
    if equipped == false then return end
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false

    coroutine.wrap(function()
    if walking == false then
    walking = true
    idle = true
    walkanim:Play()
    end
    end) ()


    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end) ()
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    equipped = false

    end)
    end)
    Also thanks for the tutorial it helped a lot

    • @RoMils-el3ij
      @RoMils-el3ij 4 หลายเดือนก่อน

      PIN THIS MAN!

    • @Spacemanjamie
      @Spacemanjamie 4 หลายเดือนก่อน

      Thanks btw I know im late but do you know how to fix the bug where the walk animation plays after you unequip the tool?

    • @zion-fs5kh
      @zion-fs5kh 3 หลายเดือนก่อน

      finnaly, you saved my life (time)

    • @GalactialStudiosOfficial
      @GalactialStudiosOfficial 2 หลายเดือนก่อน

      @@Spacemanjamie go to the Unequipped Part and write " script.Parent.Unequipped:Once(function()
      walkanim:Stop()
      idleanim:Stop()
      equipped = false
      end)
      end)" and when the player enequip the tool the walk anim will stop.

  • @Quick-rm1pu
    @Quick-rm1pu 10 หลายเดือนก่อน +3

    OMG thank you so much i was asking for that and now you made a guide , thx keep going your going to help alot of roblox devs and maybe some decent game will come out with your help.

  • @cool_blox3877
    @cool_blox3877 9 หลายเดือนก่อน +2

    Part 2 SPRINTING!!!!!!!!! Come back you are the best!! Continue being so helpful!!!!!🎉

    • @Enigmatic-v83
      @Enigmatic-v83 5 หลายเดือนก่อน

      You have to use userinput to check if the player is holding down/clicked the shift key to raise the speed and change the animation

    • @cool_blox3877
      @cool_blox3877 5 หลายเดือนก่อน

      @@Enigmatic-v83 I already did it

  • @Wastelol_yt
    @Wastelol_yt 10 หลายเดือนก่อน +2

    I have been looking for a video like this thanks so much you help me alot

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน +2

      No problem!

  • @GoldenFlamesx
    @GoldenFlamesx 8 หลายเดือนก่อน

    I've been trying to add an animation to a stupid tool for about 3hrs, this saved me, ty

  • @braskuza
    @braskuza 3 หลายเดือนก่อน +1

    to anyone having trouble with the animation still playing after unequipped:
    i revised it, this script should work
    local tool = script.Parent
    local equipped = false
    local idleanim, walkanim
    tool.Equipped:Connect(function()
    local char = tool.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    equipped = true

    idleanim = humanoid:LoadAnimation(script.CoffeeIdle)
    idleanim:Play()
    walkanim = humanoid:LoadAnimation(script.CoffeeWalk)

    local idle = true
    local walking = false

    while equipped do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false

    if not walking then
    walking = true
    walkanim:Play()
    end
    else
    if walking then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    end

    wait(0.1)
    end
    end)
    tool.Unequipped:Connect(function()
    if equipped then
    idleanim:Stop()
    walkanim:Stop()
    equipped = false
    end
    end)

    • @KN-ng3rm
      @KN-ng3rm หลายเดือนก่อน

      Thanks

  • @NiceMicePlayz
    @NiceMicePlayz 3 หลายเดือนก่อน +1

    "i am just now making a katana tool"
    the toolbox suspiciously open on the left:

  • @vystema
    @vystema 9 หลายเดือนก่อน

    Thanks :0
    Also the tool grip editor thing is rlly handy tysm :D

  • @henriquebigolin2006
    @henriquebigolin2006 3 หลายเดือนก่อน +1

    It works if I change the while loop for a property changed signal (hum)?

  • @beat2251
    @beat2251 10 หลายเดือนก่อน +3

    Just in time!,
    I'm trying to make an intermediate sword, would you mind making a video on that next?
    All other videos that show how to make swords are basic simple ones with one animation and no blocking, so i was wondering if you could take my video request?
    It's okay if not :))

  • @Luna-x7f
    @Luna-x7f หลายเดือนก่อน

    Can you help me The animation work properly but after around 1 second the default walk animation kicks in

  • @edgelord83647
    @edgelord83647 3 หลายเดือนก่อน

    THANK YOU

  • @Ydr0n
    @Ydr0n 10 หลายเดือนก่อน

    THANK YOU SNAKE ROBBS!!

  • @OmexTheDev
    @OmexTheDev 2 หลายเดือนก่อน

    my animations only work in roblox studio do you know the reason for it and if you do please tell me how to fix it

  • @rejectedstorm
    @rejectedstorm 10 หลายเดือนก่อน

    super underrated, can you make a beam tutorial??

  • @LeapInno
    @LeapInno 10 หลายเดือนก่อน

    Thanks.

  • @caboosket
    @caboosket หลายเดือนก่อน

    i had this running in the background while i was making the walk anim lol
    edit: got near the end but the walk anim aint playing, and i dont see any errors in the script + when i got to when it worked "fab" IDLE WASNT WORKING
    edit2: thx to @exyft for comenting the code i was gonna go thou pain doing what the vid did

  • @TheEmeraldAce
    @TheEmeraldAce 8 หลายเดือนก่อน +1

    How do you switch modes when animating? Like rotate to move?

    • @Rashey3
      @Rashey3 8 หลายเดือนก่อน

      r or z it depends on a keyboard for me its r

  • @GimboFlop
    @GimboFlop 10 หลายเดือนก่อน

    Nice vid

  • @Leeminyoutube
    @Leeminyoutube 4 หลายเดือนก่อน

    can you make a slash animation for this too? like on click?

  • @CalvinSantos-qw7st
    @CalvinSantos-qw7st 2 หลายเดือนก่อน

    i got no error but its not playing thr animation can anyone help?

  • @noobmusic99rbx98
    @noobmusic99rbx98 7 หลายเดือนก่อน

    What happen with my idle animation? its doesn't work perfectly its like something stuck!

  • @buvvrski
    @buvvrski 10 หลายเดือนก่อน +3

    i want to let you know that if you keep doing this you will get to 100k some day

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน +1

      Haha not sure about that but i hope so!

  • @Niles3
    @Niles3 หลายเดือนก่อน

    someone know how can i animate tools parts? *motor6d*

  • @COOL-906-e8d
    @COOL-906-e8d 8 หลายเดือนก่อน

    How do i make this but for a flashlight? I did everything correctly but its not working
    im using a action animation btw

  • @MrDoop749
    @MrDoop749 9 หลายเดือนก่อน

    How do i make it not affect the action

  • @duckyee_
    @duckyee_ 8 หลายเดือนก่อน

    Hey, it isn't working for me.
    Here's the script:
    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)

    local idle = true
    local walking = false

    coroutine.wrap(function()
    while wait() do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false

    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()

    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end)

    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    end)
    end)

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน

      Bud, It should NOT be that long. It should look like this.
      script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end)

    • @duckyee_
      @duckyee_ 8 หลายเดือนก่อน

      @@DivinedustWarrior That also doesn't work. I think it is blending with the normal walk animation and it not reverting the the normal walk animation, however I do not know how to fix that.

    • @BIMLAJOHNSON
      @BIMLAJOHNSON 3 หลายเดือนก่อน +1

      @@duckyee_ wasnt working for me too i fixed it if u are using the walk animation thingy with r6 bundle make sure ur avatar and game is set on r6 too or else it wont work or u can make another r15 animation

  • @fabioescalantemartins3891
    @fabioescalantemartins3891 8 หลายเดือนก่อน

    everything works but the walking animation is weird(only one leg works) the animation is on the option movement i tried everything but it still doesnt work

    • @fabioescalantemartins3891
      @fabioescalantemartins3891 8 หลายเดือนก่อน

      its r15

    • @abdijama812
      @abdijama812 8 หลายเดือนก่อน

      same

    • @NatDefault
      @NatDefault 6 หลายเดือนก่อน

      maybe you can try putting below the load anim one "(youranimname).Priority = Enum.AnimationPriority.Action"

  • @Abyssa_L
    @Abyssa_L 9 หลายเดือนก่อน

    for some reason im not getting any errors but the walk animation doesnt work

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน +1

      try this:
      script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end)

  • @fairieiz
    @fairieiz 8 หลายเดือนก่อน

    Im still having the walk anim play after unequipping the tool. I copied everything, even the end where you fix the bug, but it didnt work for me

    • @fairieiz
      @fairieiz 8 หลายเดือนก่อน

      NVM LOL, FIXED IT!!! TYSM BTW

    • @allusions5044
      @allusions5044 7 หลายเดือนก่อน

      how do u fix it@@fairieiz

    • @toomanyglocks
      @toomanyglocks 5 หลายเดือนก่อน

      @@fairieiz how did you fix it?

    • @solenciaga
      @solenciaga หลายเดือนก่อน

      howd you fix it?

  • @EpicGamer-mr8bb
    @EpicGamer-mr8bb 10 หลายเดือนก่อน

    How do i play a sprinting animation when the player holds shift or walkspeed is > 12?

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน +1

      i will make a sprint video next!

    • @TheRealVer_
      @TheRealVer_ 6 วันที่ผ่านมา

      @@SnakesRobbs WHERE IS IT GOOD SIR

  • @akara4ekyt
    @akara4ekyt 6 หลายเดือนก่อน

    It's doesn't work, why?😢

  • @Hittzo
    @Hittzo 10 หลายเดือนก่อน

    Ok

  • @Kiwano-hz3jw
    @Kiwano-hz3jw 10 หลายเดือนก่อน +1

    i can have the script please thanks .

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน

      script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end)

  • @pipacombate393
    @pipacombate393 10 หลายเดือนก่อน +2

    bro is the number 1 elseif hater

  • @imakesillyplaylists
    @imakesillyplaylists 10 หลายเดือนก่อน +1

    tool grip editor plugin costs 100 robux :/

  • @dustink_gaming4208
    @dustink_gaming4208 10 หลายเดือนก่อน +1

    hi

  • @Antiwall_Dev
    @Antiwall_Dev 10 หลายเดือนก่อน +2

    Heres the script! (Pin this pls)
    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)

    local idle = true
    local walking = false

    coroutine.wrap(function()
    while wait() do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false

    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()

    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end)

    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    end)
    end)

    • @AngpaoRealz.
      @AngpaoRealz. 9 หลายเดือนก่อน

      Ty

    • @mrcrow9059
      @mrcrow9059 9 หลายเดือนก่อน

      does it work
      @@AngpaoRealz.

    • @angychillface6146
      @angychillface6146 6 หลายเดือนก่อน

      He did not pin it

  • @Playprojectjjk
    @Playprojectjjk 10 หลายเดือนก่อน

    i tried but run animation don't works

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน

      can you send your code?

    • @cool_blox3877
      @cool_blox3877 9 หลายเดือนก่อน

      @@SnakesRobbs mine doesnt work too, i can send my code:
      script.Parent.Equipped:Connect(function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local equipped = true
      local idleanim = humanoid:LoadAnimation(script:WaitForChild("idle"))
      idleanim:Play()
      local walkanim = humanoid:LoadAnimation(script:WaitForChild("Walk"))
      local idle = true
      local walking = false
      coroutine.wrap(function()
      while wait() do
      if equipped == false then return end
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      idle = false
      coroutine.wrap(function()
      if walking then
      walking = true
      walkanim:Play()
      end
      end) ()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      walking = false
      idle = true
      idleanim:Play()
      end
      else
      walkanim:Stop()
      walking = false
      if idle == false then
      idle = true
      idleanim:Play()
      end
      end
      end
      end)
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      equipped = false
      end)
      end)

    • @cool_blox3877
      @cool_blox3877 9 หลายเดือนก่อน

      fixed.

  • @FangPlayz-g2x
    @FangPlayz-g2x 10 หลายเดือนก่อน

    Help Pls it wont work for me

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน

      Can you send your script?

  • @markdark9013
    @markdark9013 10 หลายเดือนก่อน

    it did not work here is my script
    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")
    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)
    local idle = true
    local walking = false
    coroutine.wrap(function()
    while wait() do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false
    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()
    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end)
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    end)
    end)

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน +1

      You didnt put () at the end of your coroutine function, so it will not run. It is a function, and you need to start a function for it to work

    • @markdark9013
      @markdark9013 10 หลายเดือนก่อน

      @@SnakesRobbs thx

    • @duckyee_
      @duckyee_ 8 หลายเดือนก่อน

      But they did put () at the end of the function??@@SnakesRobbs

  • @akurazq7180
    @akurazq7180 10 หลายเดือนก่อน

    did everything the same doesnt work

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน

      Can you send me your script?

  • @parasiter5
    @parasiter5 9 หลายเดือนก่อน

    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    local equipped = true
    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)
    local idle = true
    local walking = false
    coroutine.wrap(function()
    while wait() do
    if equipped == false then return end
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false
    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()
    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end)
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    equipped = false
    end)
    end)

    • @parasiter5
      @parasiter5 9 หลายเดือนก่อน

      if this script didnt work, notify me

    • @OfficialOwnerOfBirdClip_Studio
      @OfficialOwnerOfBirdClip_Studio 8 หลายเดือนก่อน

      @@parasiter5 so i checked for errors and there were none, yet the animation didn't play and yes it did have its animation made by me its just isn't playing everything, it was named right in the workplace so its really just the code.

  • @somerandumguy
    @somerandumguy 10 หลายเดือนก่อน

    how do u make it so it doesnt stop playing and it always plays on mobile

    • @SnakesRobbs
      @SnakesRobbs  10 หลายเดือนก่อน +1

      Remove the :stop()s

  • @ilovetoak1004
    @ilovetoak1004 9 หลายเดือนก่อน

    it doesnt work for me
    my script:
    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")

    local equipped = true
    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)
    local idle = true
    local walking = false
    coroutine.wrap(function()
    while wait() do
    if equipped == false then return end
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false
    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()
    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end)
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    equipped = false
    end)
    end)

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน

      try this:
      script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end)

  • @ShadowELITRR
    @ShadowELITRR 2 หลายเดือนก่อน +1

    Super confusing, and hard to follow because you keep moving and deleting scripts so nothing was in order

  • @DivinedustWarrior
    @DivinedustWarrior 8 หลายเดือนก่อน

    Edit: It's Working now, i just fixed it. Heres what it should look like. BTW, why is yalls scripts so long? it should look like this:
    script.Parent.Equipped:Connect (function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")
    local idleanim = humanoid:LoadAnimation(script.Idle)
    idleanim:Play()
    coroutine.wrap(function()
    while wait() do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    local walkanim = humanoid:LoadAnimation(script.Walk)
    walkanim:Play()
    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    end
    end
    end
    end) ()
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    end)
    end)
    You're Welcome (:

    • @angychillface6146
      @angychillface6146 6 หลายเดือนก่อน

      What’s the priority of the animations have to be

    • @angychillface6146
      @angychillface6146 6 หลายเดือนก่อน

      What’s the priority of the animations have to be

    • @Spacemanjamie
      @Spacemanjamie 4 หลายเดือนก่อน

      I tried your version its broken

  • @NatDefault
    @NatDefault 6 หลายเดือนก่อน

    hi there, the script doesnt want to work correctly
    im actually trying to make the walk anim play but it doesnt play and when i unequip it the idle keeps playing :(
    script.Parent.Equipped:Connect(function()
    local char = script.Parent.Parent
    local humanoid = char:FindFirstChild("Humanoid")
    local idleanim = humanoid:LoadAnimation(script:WaitForChild("IdleAnim"))
    idleanim.Priority = Enum.AnimationPriority.Action
    idleanim:Play()
    local walkanim = humanoid:LoadAnimation(script.WalkAnim)
    walkanim.Priority = Enum.AnimationPriority.Action
    local idle = true
    local walking = false
    coroutine.wrap(function()
    while wait() do
    if humanoid.MoveDirection.Magnitude ~= 0 then
    print("Walking")
    idleanim:Stop()
    idle = false
    coroutine.wrap(function()
    if walking then
    walking = true
    walkanim:Play()
    end
    end) ()
    if humanoid.MoveDirection.Magnitude == 0 then
    walkanim:Stop()
    walking = false
    idle = true
    idleanim:Play()
    end
    else
    walkanim:Stop()
    walking = false
    if idle == false then
    idle = true
    idleanim:Play()
    end
    end
    end
    end) ()
    script.Parent.Unequipped:Once(function()
    idleanim:Stop()
    end)
    end)

  • @SubscribeToScrapMetal
    @SubscribeToScrapMetal 7 หลายเดือนก่อน

    How do I make it that when I walk the sword idle and walk animation stops? I can't figure it out

    • @Noobminoss
      @Noobminoss 4 หลายเดือนก่อน

      you can put "walkanim:Stop()" at the end with the idle stop anim line when you unequip. Hope this helps

  • @demmix5555
    @demmix5555 10 หลายเดือนก่อน +1

    i tryed it but the idle animation deosnt work for me

    • @Vanchester_Sec1
      @Vanchester_Sec1 8 หลายเดือนก่อน +1

      Same it says "failed to load the ID"

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน

      script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end). youre welcome (:

    • @DivinedustWarrior
      @DivinedustWarrior 8 หลายเดือนก่อน

      @@Vanchester_Sec1 try this: script.Parent.Equipped:Connect (function()
      local char = script.Parent.Parent
      local humanoid = char:FindFirstChild("Humanoid")
      local idleanim = humanoid:LoadAnimation(script.Idle)
      idleanim:Play()
      coroutine.wrap(function()
      while wait() do
      if humanoid.MoveDirection.Magnitude ~= 0 then
      print("Walking")
      idleanim:Stop()
      local walkanim = humanoid:LoadAnimation(script.Walk)
      walkanim:Play()
      if humanoid.MoveDirection.Magnitude == 0 then
      walkanim:Stop()
      end
      end
      end
      end) ()
      script.Parent.Unequipped:Once(function()
      idleanim:Stop()
      end)
      end)

    • @demmix5555
      @demmix5555 8 หลายเดือนก่อน

      Thx