ILovePotato

Untitled

Nov 20th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.37 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local Humanoid = p.Character:WaitForChild("Humanoid")
  3.  
  4. local AnimAnim = Instance.new("Animation")
  5. AnimAnim.AnimationId = "rbxassetid://17141153099"
  6. local Anim = Humanoid:LoadAnimation(AnimAnim)
  7. AnimAnim.AnimationId = "rbxassetid://0" -- Reset animation ID
  8. Anim:Play()
  9.  
  10. local soundeffect = Instance.new("Sound")
  11. soundeffect.SoundId = "rbxassetid://17149593018"
  12. soundeffect.Parent = game.Players.LocalPlayer.Character.Torso
  13. soundeffect:Play()
  14. soundeffect.Volume = 6
  15.  
  16. local launch1 = game.ReplicatedStorage.Resources.KJEffects["launchup"].launchything:Clone()
  17. launch1.Parent = game.Players.LocalPlayer.Character["Torso"]
  18. for _, child in ipairs(launch1:GetChildren()) do
  19. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  20. child:Emit(3) -- Emit 20 particles
  21. end
  22. end
  23.  
  24.  
  25. wait(0.7)
  26.  
  27. local soundeffect = Instance.new("Sound")
  28. soundeffect.SoundId = "rbxassetid://17141392513"
  29. soundeffect.Parent = game.Players.LocalPlayer.Character.Torso
  30. soundeffect:Play()
  31. soundeffect.Volume = 1
  32.  
  33. local Players = game:GetService("Players")
  34. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  35. local Workspace = game:GetService("Workspace")
  36. local RunService = game:GetService("RunService")
  37.  
  38. -- Wait for the player to load
  39. local player = Players.LocalPlayer
  40. local character = player.Character or player.CharacterAdded:Wait()
  41.  
  42. -- Find the "Right Arm" part inside the player's character
  43. local rightArm = character:WaitForChild("HumanoidRootPart")
  44. if not rightArm then
  45. error("Right Arm part not found in player character")
  46. end
  47.  
  48. -- Check for Resources folder in ReplicatedStorage
  49. local resourcesFolder = ReplicatedStorage:WaitForChild("Resources")
  50.  
  51. -- Check for KJEffects folder inside Resources
  52. local kjEffectsFolder = resourcesFolder:WaitForChild("KJEffects")
  53.  
  54. -- Check for speedlinesandstuff part inside KJEffects
  55. local speedlinesandstuffPart = kjEffectsFolder:WaitForChild("stoicbombspeedlines")
  56.  
  57. -- Duplicate the speedlinesandstuff part
  58. local speedlinesandstuffClone = speedlinesandstuffPart:Clone()
  59.  
  60. -- Put the duplicate in Workspace
  61. speedlinesandstuffClone.Parent = Workspace
  62.  
  63. -- Set the position to the Right Arm initially
  64. speedlinesandstuffClone.CFrame = rightArm.CFrame
  65.  
  66. -- Function to enable all ParticleEmitters
  67. local function enableParticleEmitters(parent)
  68. for _, descendant in ipairs(parent:GetDescendants()) do
  69. if descendant:IsA("ParticleEmitter") then
  70. descendant.Enabled = true
  71. end
  72. end
  73. end
  74.  
  75. -- Update the clone's position every frame
  76. RunService.RenderStepped:Connect(function()
  77. if character and rightArm then
  78. speedlinesandstuffClone.CFrame = rightArm.CFrame
  79. end
  80. end)
  81.  
  82. -- Example usage after your dash effect completes
  83. spawn(function()
  84. -- Simulating end of dash effect
  85. wait(0) -- Adjust the wait time as needed
  86.  
  87. -- Enable all ParticleEmitters inside speedlinesandstuffClone
  88. enableParticleEmitters(speedlinesandstuffClone)
  89.  
  90. -- Wait for 0.7 seconds
  91. wait(0.7)
  92.  
  93. -- Destroy the cloned part
  94. speedlinesandstuffClone:Destroy()
  95. end)
  96.  
  97. local light1 = game.ReplicatedStorage.Resources.StoicBomb["stoicbombspeedlines"].POINTOLIGHTO:Clone()
  98. light1.Parent = game.Players.LocalPlayer.Character["Torso"]
  99. for _, child in ipairs(light1:GetChildren()) do
  100. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  101. child:Emit(1) -- Emit 20 particles
  102. end
  103. end
  104. local soundeffect = Instance.new("Sound")
  105. soundeffect.SoundId = "rbxassetid://17141392976"
  106. soundeffect.Parent = game.Players.LocalPlayer.Character.Torso
  107. soundeffect:Play()
  108. soundeffect.Volume = 1
  109.  
  110. local soundeffect = Instance.new("Sound")
  111. soundeffect.SoundId = "rbxassetid://17141392676"
  112. soundeffect.Parent = game.Players.LocalPlayer.Character.Torso
  113. soundeffect:Play()
  114. soundeffect.Volume = 6
  115. wait(1.4)
  116. local boom1 = game.ReplicatedStorage.Resources.KJEffects["stoic bomb boom entrance"].Attachment:Clone()
  117. boom1.Parent = game.Players.LocalPlayer.Character["Torso"]
  118. for _, child in ipairs(boom1:GetChildren()) do
  119. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  120. child:Emit(3) -- Emit 20 particles
  121. end
  122. end
  123. wait(1.6)
  124. local stoic1 = game.ReplicatedStorage.Resources.StoicBomb["pre"].Part.Attachment:Clone()
  125. stoic1.Parent = game.Players.LocalPlayer.Character["Torso"]
  126. for _, child in ipairs(stoic1:GetChildren()) do
  127. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  128. child:Emit(1) -- Emit 20 particles
  129. end
  130. end
  131.  
  132. local soundeffect = Instance.new("Sound")
  133. soundeffect.SoundId = "rbxassetid://17141392854"
  134. soundeffect.Parent = game.Players.LocalPlayer.Character.Torso
  135. soundeffect:Play()
  136. soundeffect.Volume = 1
  137. wait(0.1)
  138. local stoic2 = game.ReplicatedStorage.Resources.StoicBomb["Main"].Part.Attachment:Clone()
  139. stoic2.Parent = game.Players.LocalPlayer.Character["Torso"]
  140. for _, child in ipairs(stoic2:GetChildren()) do
  141. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  142. child:Emit(1) -- Emit 20 particles
  143. end
  144. end
  145. wait(0.1)
  146. light1:Destroy()
  147. stoic1:Destroy()
  148. stoic2:Destroy()
  149. local boom2 = game.ReplicatedStorage.Resources.KJEffects["stoic bomb boom entrance"].THEACTUALBOOM:Clone()
  150. boom2.Parent = game.Players.LocalPlayer.Character["Torso"]
  151. for _, child in ipairs(boom2:GetChildren()) do
  152. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  153. child:Emit(5) -- Emit 20 particles
  154. end
  155. end
  156. local boom3 = game.ReplicatedStorage.Resources.KJEffects["stoic bomb boom entrance"].smok:Clone()
  157. boom3.Parent = game.Players.LocalPlayer.Character["Torso"]
  158. for _, child in ipairs(boom3:GetChildren()) do
  159. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  160. child:Emit(5) -- Emit 20 particles
  161. end
  162. end
  163. local boom4 = game.ReplicatedStorage.Resources.KJEffects["stoicbombspeedlines"].Attachment:Clone()
  164. boom4.Parent = game.Players.LocalPlayer.Character["Torso"]
  165. for _, child in ipairs(boom4:GetChildren()) do
  166. if child:IsA("ParticleEmitter") then -- Check if the child is a ParticleEmitter
  167. child:Emit(1) -- Emit 20 particles
  168. end
  169. end
  170.  
  171. local TweenService = game:GetService("TweenService")
  172. local mainModel = game.ReplicatedStorage.Resources.StoicBomb.Stage1:Clone()
  173. local invertedModel = mainModel:FindFirstChild("Inverted")
  174. local windModel = mainModel:FindFirstChild("Wind")
  175. mainModel.Parent = workspace.Thrown
  176.  
  177. -- Get the character and HumanoidRootPart
  178. local character = game.Players.LocalPlayer.Character
  179. local humanoidRootPart = character and character:FindFirstChild("HumanoidRootPart")
  180.  
  181. -- Define the target scale for tweening
  182. local targetScale = Vector3.new(250, 250, 250)
  183.  
  184. -- Tween information with slower time
  185. local tweenInfo = TweenInfo.new(
  186. 0.3, -- Time (in seconds) - increased for slower resizing
  187. Enum.EasingStyle.Linear, -- EasingStyle
  188. Enum.EasingDirection.Out, -- EasingDirection
  189. 0, -- RepeatCount (0 = no repeat)
  190. false, -- Reverses (false = no reverse)
  191. 0 -- DelayTime
  192. )
  193.  
  194. -- Function to apply tween to a model
  195. local function tweenModel(model)
  196. local totalTweens = 0
  197. local completedTweens = 0
  198.  
  199. if not model then
  200. print("Error: Model is nil.")
  201. return
  202. end
  203.  
  204. for _, part in pairs(model:GetDescendants()) do
  205. if part:IsA("BasePart") then
  206. totalTweens += 1
  207. local tween = TweenService:Create(part, tweenInfo, {Size = targetScale})
  208.  
  209. print("Creating tween for part:", part.Name)
  210.  
  211. tween.Completed:Connect(function()
  212. print("Tween completed for part:", part.Name)
  213. completedTweens += 1
  214. if completedTweens == totalTweens then
  215. print("All tweens completed for model:", model.Name)
  216. mainModel:Destroy()
  217. end
  218. end)
  219.  
  220. tween:Play()
  221. print("Playing tween for part:", part.Name)
  222. else
  223. print("Skipping non-BasePart:", part.Name)
  224. end
  225. end
  226.  
  227. if totalTweens == 0 then
  228. print("No BaseParts found in model:", model.Name)
  229. mainModel:Destroy()
  230. end
  231. end
  232.  
  233. -- Function to set mainModel's CFrame to match a HumanoidRootPart
  234. local function setModelCFrameToHumanoidRootPart(model, humanoidRootPart)
  235. if not model.PrimaryPart then
  236. print("Error: The model does not have a PrimaryPart set.")
  237. return
  238. end
  239.  
  240. if humanoidRootPart then
  241. model:SetPrimaryPartCFrame(humanoidRootPart.CFrame)
  242. print("Model CFrame set to HumanoidRootPart CFrame.")
  243. else
  244. print("Error: HumanoidRootPart not found.")
  245. end
  246. end
  247.  
  248. -- Check if the HumanoidRootPart exists
  249. if humanoidRootPart then
  250. -- Set the CFrame of the mainModel
  251. setModelCFrameToHumanoidRootPart(mainModel, humanoidRootPart)
  252.  
  253. -- Tween both models
  254. if invertedModel then
  255. tweenModel(invertedModel)
  256. else
  257. print("Error: Inverted model not found.")
  258. end
  259.  
  260. if windModel then
  261. tweenModel(windModel)
  262. else
  263. print("Error: Wind model not found.")
  264. end
  265. else
  266. print("Error: HumanoidRootPart not found.")
  267. end
Add Comment
Please, Sign In to add comment