iOSdeveloper

Untitled

Feb 8th, 2025
11,751
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. local TweenService = game:GetService("TweenService")
  2. local player = game.Players.LocalPlayer
  3. local character = player.Character or player.CharacterAdded:Wait()
  4. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  5. local animationId = "rbxassetid://74760828875758"
  6. local soundId = "rbxassetid://91616529441627"
  7.  
  8. local animation = Instance.new("Animation")
  9. animation.AnimationId = animationId
  10. local humanoid = character:WaitForChild("Humanoid")
  11. local animationTrack = humanoid:LoadAnimation(animation)
  12.  
  13. local function tweenToNortheastPosition()
  14. local currentPosition = humanoidRootPart.Position
  15. local offset = (humanoidRootPart.CFrame.LookVector + humanoidRootPart.CFrame.RightVector).unit * 35
  16. local targetPosition = currentPosition + offset
  17.  
  18. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  19. local goal = {CFrame = CFrame.new(targetPosition)}
  20.  
  21. local tween = TweenService:Create(humanoidRootPart, tweenInfo, goal)
  22.  
  23. animationTrack:Play()
  24.  
  25. local sound = Instance.new("Sound")
  26. sound.SoundId = soundId
  27. sound.Parent = humanoidRootPart
  28. sound:Play()
  29.  
  30. tween:Play()
  31. tween.Completed:Wait()
  32. end
  33.  
  34. tweenToNortheastPosition()
  35.  
  36. local TweenService = game:GetService("TweenService")
  37. local player = game.Players.LocalPlayer
  38. local character = player.Character or player.CharacterAdded:Wait()
  39. local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
  40. local animationId = "rbxassetid://104460260153279"
  41. local soundId = "rbxassetid://91616529441627"
  42.  
  43. local animation = Instance.new("Animation")
  44. animation.AnimationId = animationId
  45. local humanoid = character:WaitForChild("Humanoid")
  46. local animationTrack = humanoid:LoadAnimation(animation)
  47.  
  48. local function tweenToClosePosition()
  49. local currentPosition = humanoidRootPart.Position
  50. local offset = humanoidRootPart.CFrame.LookVector * 20
  51. local targetPosition = currentPosition + offset
  52.  
  53. local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
  54. local goal = {CFrame = CFrame.new(targetPosition)}
  55.  
  56. local tween = TweenService:Create(humanoidRootPart, tweenInfo, goal)
  57.  
  58. animationTrack:Play()
  59.  
  60. local sound = Instance.new("Sound")
  61. sound.SoundId = soundId
  62. sound.Parent = humanoidRootPart
  63. sound:Play()
  64.  
  65. tween:Play()
  66. tween.Completed:Wait()
  67.  
  68. -- Keep animation and sound playing
  69. end
  70.  
  71. tweenToClosePosition()
Advertisement
Add Comment
Please, Sign In to add comment