Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local TweenService = game:GetService("TweenService")
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local animationId = "rbxassetid://74760828875758"
- local soundId = "rbxassetid://91616529441627"
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local humanoid = character:WaitForChild("Humanoid")
- local animationTrack = humanoid:LoadAnimation(animation)
- local function tweenToNortheastPosition()
- local currentPosition = humanoidRootPart.Position
- local offset = (humanoidRootPart.CFrame.LookVector + humanoidRootPart.CFrame.RightVector).unit * 35
- local targetPosition = currentPosition + offset
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local goal = {CFrame = CFrame.new(targetPosition)}
- local tween = TweenService:Create(humanoidRootPart, tweenInfo, goal)
- animationTrack:Play()
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = humanoidRootPart
- sound:Play()
- tween:Play()
- tween.Completed:Wait()
- end
- tweenToNortheastPosition()
- local TweenService = game:GetService("TweenService")
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoidRootPart = character:WaitForChild("HumanoidRootPart")
- local animationId = "rbxassetid://104460260153279"
- local soundId = "rbxassetid://91616529441627"
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local humanoid = character:WaitForChild("Humanoid")
- local animationTrack = humanoid:LoadAnimation(animation)
- local function tweenToClosePosition()
- local currentPosition = humanoidRootPart.Position
- local offset = humanoidRootPart.CFrame.LookVector * 20
- local targetPosition = currentPosition + offset
- local tweenInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
- local goal = {CFrame = CFrame.new(targetPosition)}
- local tween = TweenService:Create(humanoidRootPart, tweenInfo, goal)
- animationTrack:Play()
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = humanoidRootPart
- sound:Play()
- tween:Play()
- tween.Completed:Wait()
- -- Keep animation and sound playing
- end
- tweenToClosePosition()
Advertisement
Add Comment
Please, Sign In to add comment