Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 15 -- Distance to teleport forward
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport forward
- local function teleportForward()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportForward()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 20 -- Distance to teleport left
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport left
- local function teleportLeft()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * -teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportLeft()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 15 -- Distance to teleport forward
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport forward
- local function teleportForward()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportForward()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 20 -- Distance to teleport right
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport right
- local function teleportRight()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportRight()
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 15 -- Distance to teleport forward
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport forward
- local function teleportForward()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportForward()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 20 -- Distance to teleport left
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport left
- local function teleportLeft()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * -teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportLeft()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 15 -- Distance to teleport forward
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport forward
- local function teleportForward()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportForward()
- wait(0)
- local player = game.Players.LocalPlayer
- local character = player.Character or player.CharacterAdded:Wait()
- local humanoid = character:WaitForChild("Humanoid")
- local animationId = "rbxassetid://99916870664377"
- local soundId = "rbxassetid://70582458895457"
- local teleportDistance = 20 -- Distance to teleport right
- -- Load the animation
- local animation = Instance.new("Animation")
- animation.AnimationId = animationId
- local animationTrack = humanoid:LoadAnimation(animation)
- -- Function to teleport right
- local function teleportRight()
- -- Calculate the new position
- local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * teleportDistance)
- -- Teleport the player to the new position
- character:SetPrimaryPartCFrame(CFrame.new(newPosition))
- -- Play the animation
- animationTrack:Play()
- -- Play the sound
- local sound = Instance.new("Sound")
- sound.SoundId = soundId
- sound.Parent = character.HumanoidRootPart
- sound:Play()
- -- Optional: Wait for the animation to finish before stopping the sound
- animationTrack.Stopped:Wait()
- sound:Destroy() -- Clean up the sound after playing
- end
- -- Call the teleport function
- teleportRight()
Advertisement
Add Comment
Please, Sign In to add comment