iOSdeveloper

Untitled

Feb 1st, 2025
10,322
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.10 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoid = character:WaitForChild("Humanoid")
  4. local animationId = "rbxassetid://99916870664377"
  5. local soundId = "rbxassetid://70582458895457"
  6. local teleportDistance = 15 -- Distance to teleport forward
  7.  
  8. -- Load the animation
  9. local animation = Instance.new("Animation")
  10. animation.AnimationId = animationId
  11. local animationTrack = humanoid:LoadAnimation(animation)
  12.  
  13. -- Function to teleport forward
  14. local function teleportForward()
  15. -- Calculate the new position
  16. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
  17.  
  18. -- Teleport the player to the new position
  19. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  20.  
  21. -- Play the animation
  22. animationTrack:Play()
  23.  
  24. -- Play the sound
  25. local sound = Instance.new("Sound")
  26. sound.SoundId = soundId
  27. sound.Parent = character.HumanoidRootPart
  28. sound:Play()
  29.  
  30. -- Optional: Wait for the animation to finish before stopping the sound
  31. animationTrack.Stopped:Wait()
  32. sound:Destroy() -- Clean up the sound after playing
  33. end
  34.  
  35. -- Call the teleport function
  36. teleportForward()
  37. wait(0)
  38. local player = game.Players.LocalPlayer
  39. local character = player.Character or player.CharacterAdded:Wait()
  40. local humanoid = character:WaitForChild("Humanoid")
  41. local animationId = "rbxassetid://99916870664377"
  42. local soundId = "rbxassetid://70582458895457"
  43. local teleportDistance = 20 -- Distance to teleport left
  44.  
  45. -- Load the animation
  46. local animation = Instance.new("Animation")
  47. animation.AnimationId = animationId
  48. local animationTrack = humanoid:LoadAnimation(animation)
  49.  
  50. -- Function to teleport left
  51. local function teleportLeft()
  52. -- Calculate the new position
  53. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * -teleportDistance)
  54.  
  55. -- Teleport the player to the new position
  56. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  57.  
  58. -- Play the animation
  59. animationTrack:Play()
  60.  
  61. -- Play the sound
  62. local sound = Instance.new("Sound")
  63. sound.SoundId = soundId
  64. sound.Parent = character.HumanoidRootPart
  65. sound:Play()
  66.  
  67. -- Optional: Wait for the animation to finish before stopping the sound
  68. animationTrack.Stopped:Wait()
  69. sound:Destroy() -- Clean up the sound after playing
  70. end
  71.  
  72. -- Call the teleport function
  73. teleportLeft()
  74. wait(0)
  75. local player = game.Players.LocalPlayer
  76. local character = player.Character or player.CharacterAdded:Wait()
  77. local humanoid = character:WaitForChild("Humanoid")
  78. local animationId = "rbxassetid://99916870664377"
  79. local soundId = "rbxassetid://70582458895457"
  80. local teleportDistance = 15 -- Distance to teleport forward
  81.  
  82. -- Load the animation
  83. local animation = Instance.new("Animation")
  84. animation.AnimationId = animationId
  85. local animationTrack = humanoid:LoadAnimation(animation)
  86.  
  87. -- Function to teleport forward
  88. local function teleportForward()
  89. -- Calculate the new position
  90. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
  91.  
  92. -- Teleport the player to the new position
  93. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  94.  
  95. -- Play the animation
  96. animationTrack:Play()
  97.  
  98. -- Play the sound
  99. local sound = Instance.new("Sound")
  100. sound.SoundId = soundId
  101. sound.Parent = character.HumanoidRootPart
  102. sound:Play()
  103.  
  104. -- Optional: Wait for the animation to finish before stopping the sound
  105. animationTrack.Stopped:Wait()
  106. sound:Destroy() -- Clean up the sound after playing
  107. end
  108.  
  109. -- Call the teleport function
  110. teleportForward()
  111. wait(0)
  112. local player = game.Players.LocalPlayer
  113. local character = player.Character or player.CharacterAdded:Wait()
  114. local humanoid = character:WaitForChild("Humanoid")
  115. local animationId = "rbxassetid://99916870664377"
  116. local soundId = "rbxassetid://70582458895457"
  117. local teleportDistance = 20 -- Distance to teleport right
  118.  
  119. -- Load the animation
  120. local animation = Instance.new("Animation")
  121. animation.AnimationId = animationId
  122. local animationTrack = humanoid:LoadAnimation(animation)
  123.  
  124. -- Function to teleport right
  125. local function teleportRight()
  126. -- Calculate the new position
  127. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * teleportDistance)
  128.  
  129. -- Teleport the player to the new position
  130. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  131.  
  132. -- Play the animation
  133. animationTrack:Play()
  134.  
  135. -- Play the sound
  136. local sound = Instance.new("Sound")
  137. sound.SoundId = soundId
  138. sound.Parent = character.HumanoidRootPart
  139. sound:Play()
  140.  
  141. -- Optional: Wait for the animation to finish before stopping the sound
  142. animationTrack.Stopped:Wait()
  143. sound:Destroy() -- Clean up the sound after playing
  144. end
  145.  
  146. -- Call the teleport function
  147. teleportRight()
  148.  
  149. local player = game.Players.LocalPlayer
  150. local character = player.Character or player.CharacterAdded:Wait()
  151. local humanoid = character:WaitForChild("Humanoid")
  152. local animationId = "rbxassetid://99916870664377"
  153. local soundId = "rbxassetid://70582458895457"
  154. local teleportDistance = 15 -- Distance to teleport forward
  155.  
  156. -- Load the animation
  157. local animation = Instance.new("Animation")
  158. animation.AnimationId = animationId
  159. local animationTrack = humanoid:LoadAnimation(animation)
  160.  
  161. -- Function to teleport forward
  162. local function teleportForward()
  163. -- Calculate the new position
  164. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
  165.  
  166. -- Teleport the player to the new position
  167. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  168.  
  169. -- Play the animation
  170. animationTrack:Play()
  171.  
  172. -- Play the sound
  173. local sound = Instance.new("Sound")
  174. sound.SoundId = soundId
  175. sound.Parent = character.HumanoidRootPart
  176. sound:Play()
  177.  
  178. -- Optional: Wait for the animation to finish before stopping the sound
  179. animationTrack.Stopped:Wait()
  180. sound:Destroy() -- Clean up the sound after playing
  181. end
  182.  
  183. -- Call the teleport function
  184. teleportForward()
  185. wait(0)
  186. local player = game.Players.LocalPlayer
  187. local character = player.Character or player.CharacterAdded:Wait()
  188. local humanoid = character:WaitForChild("Humanoid")
  189. local animationId = "rbxassetid://99916870664377"
  190. local soundId = "rbxassetid://70582458895457"
  191. local teleportDistance = 20 -- Distance to teleport left
  192.  
  193. -- Load the animation
  194. local animation = Instance.new("Animation")
  195. animation.AnimationId = animationId
  196. local animationTrack = humanoid:LoadAnimation(animation)
  197.  
  198. -- Function to teleport left
  199. local function teleportLeft()
  200. -- Calculate the new position
  201. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * -teleportDistance)
  202.  
  203. -- Teleport the player to the new position
  204. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  205.  
  206. -- Play the animation
  207. animationTrack:Play()
  208.  
  209. -- Play the sound
  210. local sound = Instance.new("Sound")
  211. sound.SoundId = soundId
  212. sound.Parent = character.HumanoidRootPart
  213. sound:Play()
  214.  
  215. -- Optional: Wait for the animation to finish before stopping the sound
  216. animationTrack.Stopped:Wait()
  217. sound:Destroy() -- Clean up the sound after playing
  218. end
  219.  
  220. -- Call the teleport function
  221. teleportLeft()
  222. wait(0)
  223. local player = game.Players.LocalPlayer
  224. local character = player.Character or player.CharacterAdded:Wait()
  225. local humanoid = character:WaitForChild("Humanoid")
  226. local animationId = "rbxassetid://99916870664377"
  227. local soundId = "rbxassetid://70582458895457"
  228. local teleportDistance = 15 -- Distance to teleport forward
  229.  
  230. -- Load the animation
  231. local animation = Instance.new("Animation")
  232. animation.AnimationId = animationId
  233. local animationTrack = humanoid:LoadAnimation(animation)
  234.  
  235. -- Function to teleport forward
  236. local function teleportForward()
  237. -- Calculate the new position
  238. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.LookVector * teleportDistance)
  239.  
  240. -- Teleport the player to the new position
  241. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  242.  
  243. -- Play the animation
  244. animationTrack:Play()
  245.  
  246. -- Play the sound
  247. local sound = Instance.new("Sound")
  248. sound.SoundId = soundId
  249. sound.Parent = character.HumanoidRootPart
  250. sound:Play()
  251.  
  252. -- Optional: Wait for the animation to finish before stopping the sound
  253. animationTrack.Stopped:Wait()
  254. sound:Destroy() -- Clean up the sound after playing
  255. end
  256.  
  257. -- Call the teleport function
  258. teleportForward()
  259. wait(0)
  260. local player = game.Players.LocalPlayer
  261. local character = player.Character or player.CharacterAdded:Wait()
  262. local humanoid = character:WaitForChild("Humanoid")
  263. local animationId = "rbxassetid://99916870664377"
  264. local soundId = "rbxassetid://70582458895457"
  265. local teleportDistance = 20 -- Distance to teleport right
  266.  
  267. -- Load the animation
  268. local animation = Instance.new("Animation")
  269. animation.AnimationId = animationId
  270. local animationTrack = humanoid:LoadAnimation(animation)
  271.  
  272. -- Function to teleport right
  273. local function teleportRight()
  274. -- Calculate the new position
  275. local newPosition = character.HumanoidRootPart.Position + (character.HumanoidRootPart.CFrame.RightVector * teleportDistance)
  276.  
  277. -- Teleport the player to the new position
  278. character:SetPrimaryPartCFrame(CFrame.new(newPosition))
  279.  
  280. -- Play the animation
  281. animationTrack:Play()
  282.  
  283. -- Play the sound
  284. local sound = Instance.new("Sound")
  285. sound.SoundId = soundId
  286. sound.Parent = character.HumanoidRootPart
  287. sound:Play()
  288.  
  289. -- Optional: Wait for the animation to finish before stopping the sound
  290. animationTrack.Stopped:Wait()
  291. sound:Destroy() -- Clean up the sound after playing
  292. end
  293.  
  294. -- Call the teleport function
  295. teleportRight()
Advertisement
Add Comment
Please, Sign In to add comment