Advertisement
Yondiux

Animacion al volar

Apr 15th, 2021
2,924
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. repeat wait() until game.Players.LocalPlayer.Character
  2.  
  3.  
  4.  
  5. local plr = game.Players.LocalPlayer
  6.  
  7. local char = plr.Character
  8.  
  9. local hum = char:WaitForChild("Humanoid")
  10.  
  11. local Torso = char:WaitForChild("LowerTorso")
  12.  
  13. local Mouse = plr:GetMouse()
  14.  
  15. local toggle = false
  16.  
  17.  
  18.  
  19. Mouse.KeyDown:Connect(function(key)
  20.  
  21. if key == "f" then -- Key Code
  22.  
  23. if toggle == false then
  24.  
  25. toggle = true
  26.  
  27. local Anim = Instance.new("Animation")
  28.  
  29. Anim.AnimationId = "rbxassetid://" -- CODIGO DE ANIMACION A LADO DE LOS // ->
  30.  
  31. local PlayAnim = hum:LoadAnimation(Anim)
  32.  
  33. PlayAnim:Play()
  34.  
  35. local BV = Instance.new("BodyVelocity",Torso)
  36.  
  37. BV.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
  38.  
  39. while toggle == true do
  40.  
  41. BV.Velocity = Mouse.Hit.lookVector*100
  42.  
  43. wait()
  44.  
  45. end
  46.  
  47. end
  48.  
  49. if toggle == true then
  50.  
  51. toggle = false
  52.  
  53. Torso:FindFirstChildOfClass("BodyVelocity"):remove()
  54.  
  55. local tracks = hum:GetPlayingAnimationTracks()
  56.  
  57. for i, stoptracks in pairs(tracks) do
  58.  
  59. stoptracks:Stop()
  60.  
  61. end
  62.  
  63. local Anim = Instance.new("Animation")
  64.  
  65. Anim.AnimationId = "" -- CODIGO DE LA ANIMACION
  66.  
  67. local PlayAnim = hum:LoadAnimation(Anim)
  68.  
  69. PlayAnim:Play()
  70.  
  71. end
  72.  
  73. end
  74.  
  75. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement