Advertisement
Guest User

grate

a guest
Apr 19th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.04 KB | None | 0 0
  1. --Thanks for using Build2Script Plugin by jarredbcv!
  2. if (script:FindFirstChild("forCustomRun")~=nil) then
  3. local sc = script["forCustomRun"].Value
  4. assert(loadstring(sc))()
  5. return
  6. elseif (script:FindFirstChild("forCustomRunL")~=nil) then
  7. local locsc = workspace:FindFirstChild("_localrun")
  8. local sc = script["forCustomRunL"]
  9. if (locsc~=nil) then
  10. local loc = locsc:clone()
  11. loc["scrun"].Value = sc.Value
  12. loc.Name = script.Name
  13. for i,v in pairs(script:GetChildren()) do
  14. v:clone().Parent = loc
  15. end
  16. loc.Parent = script.Parent
  17. script:remove()
  18. return
  19. else
  20. assert(loadstring(sc.Value))()
  21. return
  22. end
  23. end
  24. local m = Instance.new("Model")
  25. m.Name = "EarthDaySummoningHorn"
  26. t1 = Instance.new("Tool", m)
  27. t1.Name = "EarthDaySummoningHorn"
  28. t1.GripForward = Vector3.new(0, 1, -8.10044585e-05)
  29. t1.GripPos = Vector3.new(0, -1, 0)
  30. t1.GripUp = Vector3.new(0, 8.10044585e-05, 1)
  31. t1.TextureId = "http://www.roblox.com/asset/?id=233694007"
  32. t1.Enabled = false
  33. p1 = Instance.new("Part", t1)
  34. p1.BrickColor = BrickColor.new("Medium stone grey")
  35. p1.Name = "Handle"
  36. p1.FormFactor = Enum.FormFactor.Custom
  37. p1.Size = Vector3.new(1, 1.75, 2.75)
  38. p1.CFrame = CFrame.new(8.86174774, 1.68678606, 8.64301205, 1, 0, 0, 0, 0.499999911, 0.866025329, 0, -0.866025329, 0.499999911)
  39. p1.Locked = true
  40. p1.BottomSurface = Enum.SurfaceType.Smooth
  41. p1.TopSurface = Enum.SurfaceType.Smooth
  42. b1 = Instance.new("SpecialMesh", p1)
  43. b1.MeshId = "http://www.roblox.com/asset/?id=233693740"
  44. b1.TextureId = "http://www.roblox.com/asset/?id=233693812"
  45. b1.MeshType = Enum.MeshType.FileMesh
  46. b1.Name = "Mesh"
  47. b1.Scale = Vector3.new(0.400000006, 0.400000006, 0.400000006)
  48. x1 = Instance.new("Sound", p1)
  49. x1.Name = "Horn"
  50. x1.Pitch = 1
  51. x1.SoundId = "http://www.roblox.com/asset/?id=235742483"
  52. x1.Volume = 0.5
  53. x1.Looped = false
  54. x1.PlayOnRemove = false
  55. x2 = Instance.new("Sound", p1)
  56. x2.Name = "Earthquake"
  57. x2.Pitch = 1
  58. x2.SoundId = "http://www.roblox.com/asset/?id=102546080"
  59. x2.Volume = 0.69999998807907
  60. x2.Looped = true
  61. x2.PlayOnRemove = false
  62. x3 = Instance.new("Sound", p1)
  63. x3.Name = "RockFall"
  64. x3.Pitch = 1
  65. x3.SoundId = "http://www.roblox.com/asset/?id=102544922"
  66. x3.Volume = 0.5
  67. x3.Looped = false
  68. x3.PlayOnRemove = false
  69. s1 = script:clone()
  70. s1.Name = "MotorizeGrip"
  71. s1.Disabled = false
  72. so1 = Instance.new("StringValue", s1)
  73. so1.Name = "forCustomRun"
  74. so1.Value = [===[
  75. --Made by Luckymaxer
  76.  
  77. Tool = script.Parent
  78. Handle = Tool:WaitForChild("Handle")
  79.  
  80. Players = game:GetService("Players")
  81.  
  82. function CheckIfAlive()
  83. return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
  84. end
  85.  
  86. function Equipped()
  87. Character = Tool.Parent
  88. Humanoid = Character:FindFirstChild("Humanoid")
  89. Player = Players:GetPlayerFromCharacter(Character)
  90. if not CheckIfAlive() then
  91. return
  92. end
  93. local RightArm = Character:FindFirstChild("Right Arm")
  94. if RightArm then
  95. local RightGrip = RightArm:FindFirstChild("RightGrip")
  96. if RightGrip then
  97. RightGripMotor = Instance.new("Motor6D")
  98. RightGripMotor.Name = "RightGrip"
  99. RightGripMotor.Part0 = RightGrip.Part0
  100. RightGripMotor.Part1 = RightGrip.Part1
  101. RightGripMotor.C0 = RightGrip.C0
  102. RightGripMotor.C1 = RightGrip.C1
  103. RightGrip:Destroy()
  104. RightGripMotor.Parent = RightArm
  105. end
  106. end
  107. end
  108.  
  109. function Unequipped()
  110. if RightGripMotor and RightGripMotor.Parent then
  111. RightGripMotor:Destroy()
  112. end
  113. end
  114.  
  115. Tool.Equipped:connect(Equipped)
  116. Tool.Unequipped:connect(Unequipped)
  117. ]===]
  118. s1.Parent = t1
  119. s2 = script:clone()
  120. s2.Name = "MouseIcon"
  121. s2.Disabled = false
  122. so2 = Instance.new("StringValue", s2)
  123. so2.Name = "forCustomRunL"
  124. so2.Value = [===[
  125. --Made by Luckymaxer
  126.  
  127. Mouse_Icon = "rbxasset://textures/GunCursor.png"
  128. Reloading_Icon = "rbxasset://textures/GunWaitCursor.png"
  129.  
  130. Tool = script.Parent
  131.  
  132. Mouse = nil
  133.  
  134. function UpdateIcon()
  135. if Mouse then
  136. Mouse.Icon = Tool.Enabled and Mouse_Icon or Reloading_Icon
  137. end
  138. end
  139.  
  140. function OnEquipped(ToolMouse)
  141. Mouse = ToolMouse
  142. UpdateIcon()
  143. end
  144.  
  145. function OnChanged(Property)
  146. if Property == "Enabled" then
  147. UpdateIcon()
  148. end
  149. end
  150.  
  151. Tool.Equipped:connect(OnEquipped)
  152. Tool.Changed:connect(OnChanged)
  153.  
  154. ]===]
  155. s2.Parent = t1
  156. s3 = script:clone()
  157. s3.Name = "LocalScript"
  158. s3.Disabled = false
  159. so3 = Instance.new("StringValue", s3)
  160. so3.Name = "forCustomRunL"
  161. so3.Value = [===[
  162. --Made by Luckymaxer
  163.  
  164. Tool = script.Parent
  165. Handle = Tool:WaitForChild("Handle")
  166.  
  167. Players = game:GetService("Players")
  168. RunService = game:GetService("RunService")
  169.  
  170. Animations = {}
  171. LocalObjects = {}
  172.  
  173. ServerControl = Tool:WaitForChild("ServerControl")
  174. ClientControl = Tool:WaitForChild("ClientControl")
  175.  
  176. ToolEquipped = false
  177.  
  178. function SetAnimation(mode, value)
  179. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  180. for i, v in pairs(Animations) do
  181. if v.Animation == value.Animation then
  182. v.AnimationTrack:Stop()
  183. table.remove(Animations, i)
  184. end
  185. end
  186. local AnimationTrack = Humanoid:LoadAnimation(value.Animation)
  187. table.insert(Animations, {Animation = value.Animation, AnimationTrack = AnimationTrack})
  188. AnimationTrack:Play(value.FadeTime, value.Weight, value.Speed)
  189. elseif mode == "StopAnimation" and value then
  190. for i, v in pairs(Animations) do
  191. if v.Animation == value.Animation then
  192. v.AnimationTrack:Stop(value.FadeTime)
  193. table.remove(Animations, i)
  194. end
  195. end
  196. end
  197. end
  198.  
  199. function DisableJump(Boolean)
  200. if PreventJump then
  201. PreventJump:disconnect()
  202. end
  203. if Boolean then
  204. PreventJump = Humanoid.Changed:connect(function(Property)
  205. if Property == "Jump" then
  206. Humanoid.Jump = false
  207. end
  208. end)
  209. end
  210. end
  211.  
  212. function CheckIfAlive()
  213. return (((Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Player and Player.Parent) and true) or false)
  214. end
  215.  
  216. function Equipped(Mouse)
  217. Character = Tool.Parent
  218. Player = Players:GetPlayerFromCharacter(Character)
  219. Humanoid = Character:FindFirstChild("Humanoid")
  220. ToolEquipped = true
  221. if not CheckIfAlive() then
  222. return
  223. end
  224. PlayerMouse = Player:GetMouse()
  225. Mouse.Button1Down:connect(function()
  226. InvokeServer("Button1Click", {Down = true})
  227. end)
  228. Mouse.Button1Up:connect(function()
  229. InvokeServer("Button1Click", {Down = false})
  230. end)
  231. Mouse.Button2Down:connect(function()
  232. InvokeServer("Button2Click", {Down = true})
  233. end)
  234. Mouse.Button2Up:connect(function()
  235. InvokeServer("Button2Click", {Down = false})
  236. end)
  237. Mouse.KeyDown:connect(function(Key)
  238. InvokeServer("KeyPress", {Key = Key, Down = true})
  239. end)
  240. Mouse.KeyUp:connect(function(Key)
  241. InvokeServer("KeyPress", {Key = Key, Down = false})
  242. end)
  243. Mouse.Move:connect(function()
  244. InvokeServer("MouseMove", {Position = Mouse.Hit.p, Target = Mouse.Target})
  245. end)
  246. end
  247.  
  248. function Unequipped()
  249. ToolEquipped = false
  250. LocalObjects = {}
  251. for i, v in pairs(Animations) do
  252. if v and v.AnimationTrack then
  253. v.AnimationTrack:Stop()
  254. end
  255. end
  256. for i, v in pairs({PreventJump, ObjectLocalTransparencyModifier}) do
  257. if v then
  258. v:disconnect()
  259. end
  260. end
  261. Animations = {}
  262. end
  263.  
  264. function InvokeServer(mode, value)
  265. local ServerReturn
  266. pcall(function()
  267. ServerReturn = ServerControl:InvokeServer(mode, value)
  268. end)
  269. return ServerReturn
  270. end
  271.  
  272. function OnClientInvoke(mode, value)
  273. if mode == "PlayAnimation" and value and ToolEquipped and Humanoid then
  274. SetAnimation("PlayAnimation", value)
  275. elseif mode == "StopAnimation" and value then
  276. SetAnimation("StopAnimation", value)
  277. elseif mode == "PlaySound" and value then
  278. value:Play()
  279. elseif mode == "StopSound" and value then
  280. value:Stop()
  281. elseif mode == "MousePosition" then
  282. return {Position = PlayerMouse.Hit.p, Target = PlayerMouse.Target}
  283. elseif mode == "DisableJump" then
  284. DisableJump(value)
  285. elseif mode == "SetLocalTransparencyModifier" and value and ToolEquipped then
  286. pcall(function()
  287. local ObjectFound = false
  288. for i, v in pairs(LocalObjects) do
  289. if v == value then
  290. ObjectFound = true
  291. end
  292. end
  293. if not ObjectFound then
  294. table.insert(LocalObjects, value)
  295. if ObjectLocalTransparencyModifier then
  296. ObjectLocalTransparencyModifier:disconnect()
  297. end
  298. ObjectLocalTransparencyModifier = RunService.RenderStepped:connect(function()
  299. for i, v in pairs(LocalObjects) do
  300. if v.Object and v.Object.Parent then
  301. local CurrentTransparency = v.Object.LocalTransparencyModifier
  302. if ((not v.AutoUpdate and (CurrentTransparency == 1 or CurrentTransparency == 0)) or v.AutoUpdate) then
  303. v.Object.LocalTransparencyModifier = v.Transparency
  304. end
  305. else
  306. table.remove(LocalObjects, i)
  307. end
  308. end
  309. end)
  310. end
  311. end)
  312. end
  313. end
  314.  
  315. ClientControl.OnClientInvoke = OnClientInvoke
  316. Tool.Equipped:connect(Equipped)
  317. Tool.Unequipped:connect(Unequipped)
  318. ]===]
  319. s3.Parent = t1
  320. x4 = Instance.new("Animation", t1)
  321. x4.Name = "Blow"
  322. x4.AnimationId = "http://www.roblox.com/asset/?id=235543257"
  323. s4 = script:clone()
  324. s5 = script:clone()
  325. s5.Name = "CameraShake"
  326. s5.Disabled = true
  327. so5 = Instance.new("StringValue", s5)
  328. so5.Name = "forCustomRunL"
  329. so5.Value = [===[
  330. --Made by Luckymaxer
  331.  
  332. Camera = game:GetService("Workspace").CurrentCamera
  333.  
  334. Rate = (1 / 60)
  335.  
  336. Shake = {Movement = 20, Rate = 0.001}
  337.  
  338. local CoordinateFrame = Camera.CoordinateFrame
  339. local Focus = Camera.Focus
  340. while true do
  341. local CameraRotation = Camera.CoordinateFrame - Camera.CoordinateFrame.p
  342. local CameraScroll = (CoordinateFrame.p - Focus.p).magnitude
  343. local NewCFrame = CFrame.new(Camera.Focus.p) * CameraRotation * CFrame.fromEulerAnglesXYZ((math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), (math.random(-Shake.Movement, Shake.Movement) * Shake.Rate), 0)
  344. CoordinateFrame = NewCFrame * CFrame.new(0, 0, CameraScroll)
  345. Camera.CoordinateFrame = CoordinateFrame
  346. wait(Rate)
  347. end
  348. ]===]
  349. s5.Parent = s4
  350. s6 = script:clone()
  351. s6.Name = "TripScript"
  352. s6.Disabled = false
  353. so6 = Instance.new("StringValue", s6)
  354. so6.Name = "forCustomRunL"
  355. so6.Value = [===[
  356. --Made by Luckymaxer
  357.  
  358. Character = script.Parent
  359. Humanoid = Character:WaitForChild("Humanoid")
  360. Torso = Character:WaitForChild("Torso")
  361.  
  362. Humanoid:ChangeState(Enum.HumanoidStateType.FallingDown)
  363.  
  364. Humanoid.Changed:connect(function(Property)
  365. Humanoid.Jump = false
  366. --Humanoid.Sit = true
  367. end)
  368. ]===]
  369. s6.Parent = s4
  370. s4.Name = "Script"
  371. s4.Disabled = false
  372. so4 = Instance.new("StringValue", s4)
  373. so4.Name = "forCustomRun"
  374. so4.Value = [===[
  375. --Made by Luckymaxer
  376.  
  377. Tool = script.Parent
  378. Handle = Tool:WaitForChild("Handle")
  379.  
  380. Players = game:GetService("Players")
  381. Debris = game:GetService("Debris")
  382. InsertService = game:GetService("InsertService")
  383.  
  384. CameraShake = script:WaitForChild("CameraShake")
  385. TripScript = script:WaitForChild("TripScript")
  386.  
  387. BaseUrl = "http://www.roblox.com/asset/?id="
  388.  
  389. BasePart = Instance.new("Part")
  390. BasePart.Shape = Enum.PartType.Block
  391. BasePart.Material = Enum.Material.Plastic
  392. BasePart.TopSurface = Enum.SurfaceType.Smooth
  393. BasePart.BottomSurface = Enum.SurfaceType.Smooth
  394. BasePart.FormFactor = Enum.FormFactor.Custom
  395. BasePart.Size = Vector3.new(0.2, 0.2, 0.2)
  396. BasePart.CanCollide = true
  397. BasePart.Locked = true
  398. BasePart.Anchored = false
  399.  
  400. ShockWave = BasePart:Clone()
  401. ShockWave.Name = "ShockWave"
  402. ShockWave.Transparency = 1
  403. ShockWave.Size = Vector3.new(0.2, 4, 0.2)
  404. ShockWave.Anchored = true
  405. ShockWave.CanCollide = false
  406. Mesh = Instance.new("SpecialMesh")
  407. Mesh.MeshType = Enum.MeshType.Brick
  408. Mesh.Scale = Vector3.new(1, 0, 1)
  409. Mesh.Parent = ShockWave
  410. for i = 1, 2 do
  411. local Decal = Instance.new("Decal")
  412. Decal.Texture = "http://www.roblox.com/asset?id=183210124"
  413. Decal.Transparency = 0.125
  414. Decal.Face = ((i == 1 and Enum.NormalId.Top) or Enum.NormalId.Bottom)
  415. Decal.Parent = ShockWave
  416. end
  417.  
  418. Animations = {
  419. Blow = {Animation = Tool:WaitForChild("Blow"), FadeTime = 0.75, Weight = nil, Speed = 0.5, Duration = 1},
  420. }
  421.  
  422. Sounds = {
  423. Horn = Handle:WaitForChild("Horn"),
  424. Earthquake = Handle:WaitForChild("Earthquake"),
  425. RockFall = Handle:WaitForChild("RockFall"),
  426. }
  427.  
  428. ToolEquipped = false
  429. ReloadTime = 12
  430.  
  431. Gravity = 196.20
  432. Rate = (1 / 60)
  433.  
  434. ServerControl = (Tool:FindFirstChild("ServerControl") or Instance.new("RemoteFunction"))
  435. ServerControl.Name = "ServerControl"
  436. ServerControl.Parent = Tool
  437.  
  438. ClientControl = (Tool:FindFirstChild("ClientControl") or Instance.new("RemoteFunction"))
  439. ClientControl.Name = "ClientControl"
  440. ClientControl.Parent = Tool
  441.  
  442. Tool.Enabled = true
  443.  
  444. function RayCast(Position, Direction, MaxDistance, IgnoreList)
  445. local IgnoreList = ((type(IgnoreList) == "table" and IgnoreList) or {IgnoreList})
  446. return game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(Position, Direction.unit * (MaxDistance or 999.999)), IgnoreList)
  447. end
  448.  
  449. function IsTeamMate(Player1, Player2)
  450. return (Player1 and Player2 and not Player1.Neutral and not Player2.Neutral and Player1.TeamColor == Player2.TeamColor)
  451. end
  452.  
  453. function TagHumanoid(humanoid, player)
  454. local Creator_Tag = Instance.new("ObjectValue")
  455. Creator_Tag.Name = "creator"
  456. Creator_Tag.Value = player
  457. Debris:AddItem(Creator_Tag, 2)
  458. Creator_Tag.Parent = humanoid
  459. end
  460.  
  461. function UntagHumanoid(humanoid)
  462. for i, v in pairs(humanoid:GetChildren()) do
  463. if v:IsA("ObjectValue") and v.Name == "creator" then
  464. v:Destroy()
  465. end
  466. end
  467. end
  468.  
  469. function CheckTableForInstance(Table, Instance)
  470. for i, v in pairs(Table) do
  471. if v == Instance then
  472. return true
  473. end
  474. end
  475. return false
  476. end
  477.  
  478.  
  479. function GetTotalParts(MaxParts, PossibleParts, Parts)
  480. if MaxParts < PossibleParts then
  481. return MaxParts
  482. elseif Parts >= MaxParts then
  483. return 0
  484. elseif MaxParts >= PossibleParts then
  485. local PartCount = (MaxParts - PossibleParts)
  486. if Parts <= MaxParts then
  487. PartCount = (MaxParts - Parts)
  488. if PartCount > PossibleParts then
  489. return PossibleParts
  490. else
  491. return PartCount
  492. end
  493. elseif PartCount >= PossibleParts then
  494. return PossibleParts
  495. else
  496. return PartCount
  497. end
  498. end
  499. end
  500.  
  501. function GetParts(Region, MaxParts, Ignore)
  502. local Parts = {}
  503. local RerunFailed = false
  504. while #Parts < MaxParts and not RerunFailed do
  505. local Region = Region
  506. local PossibleParts = GetTotalParts(MaxParts, 3000, #Parts)
  507. local PartsNearby = game:GetService("Workspace"):FindPartsInRegion3WithIgnoreList(Region, Ignore, PossibleParts)
  508. if #PartsNearby == 0 then
  509. RerunFailed = true
  510. else
  511. for i, v in pairs(PartsNearby) do
  512. table.insert(Parts, v)
  513. table.insert(Ignore, v)
  514. end
  515. end
  516. end
  517. return Parts
  518. end
  519.  
  520. function Shake()
  521. local UserPlayer = Player
  522. local UserCharacter = Character
  523. local IgnoreObjects = {UserCharacter, Tool}
  524. local Radius = 45
  525. local ShakeForce = {Min = 5, Max = 10}
  526. local Objects = {}
  527. local Humanoids = {}
  528. local PlayersNearby = {}
  529. local NegativeRadius = (Torso.Position - Vector3.new(Radius, (Torso.Size.Y * 1.25), Radius))
  530. local PositiveRadius = (Torso.Position + Vector3.new(Radius, (Radius / 6), Radius))
  531. for i, v in pairs(Players:GetChildren()) do
  532. if v:IsA("Player") and v ~= UserPlayer then
  533. local character = v.Character
  534. if character and character.Parent then
  535. table.insert(IgnoreObjects, v)
  536. if not IsTeamMate(v, UserPlayer) then
  537. local humanoid = character:FindFirstChild("Humanoid")
  538. local torso = character:FindFirstChild("Torso")
  539. if humanoid and humanoid.Health > 0 and (Torso.Position - torso.Position).magnitude <= Radius then
  540. table.insert(Humanoids, humanoid)
  541. end
  542. end
  543. end
  544. end
  545. end
  546. local Parts = GetParts(Region3.new(NegativeRadius, PositiveRadius), 500, IgnoreObjects)
  547. for i, v in pairs(Parts) do
  548. if v and v.Parent and not CheckTableForInstance(Objects, v) then
  549. local character = v.Parent
  550. if character:IsA("Hat") or character:IsA("Tool") then
  551. character = character.Parent
  552. end
  553. local humanoid = character:FindFirstChild("Humanoid")
  554. local player = Players:GetPlayerFromCharacter(character)
  555. if not CheckTableForInstance(Humanoids, humanoid) and not CheckTableForInstance(PlayersNearby, character) then
  556. if humanoid and humanoid.Health > 0 and not CheckTableForInstance(Humanoids, humanoid) then
  557. table.insert(Humanoids, humanoid)
  558. if player and not CheckTableForInstance(PlayersNearby, player) then
  559. table.insert(PlayersNearby, player)
  560. end
  561. elseif (Torso.Position - v.Position).magnitude <= Radius then
  562. table.insert(Objects, v)
  563. end
  564. end
  565. end
  566. end
  567. for i, v in pairs(Objects) do
  568. if v and v.Parent then
  569. if not v:IsGrounded() then
  570. if v:GetMass() <= 80 then
  571. local ConnectedParts = #v:GetConnectedParts()
  572. if v.Velocity.magnitude < 20 and ConnectedParts == 1 then
  573. local Velocity = Vector3.new(math.random(-math.random(ShakeForce.Min, ShakeForce.Max), math.random(ShakeForce.Min, ShakeForce.Max)), v.Velocity.Y, math.random(-math.random(ShakeForce.Min, ShakeForce.Max), math.random(ShakeForce.Min, ShakeForce.Max)))
  574. Velocity = Vector3.new(Velocity.X, v.Velocity.Y, Velocity.Z)
  575. v.Velocity = Velocity
  576. end
  577. if ConnectedParts > 0 then
  578. local ChanceToBreak = math.random(1, 1000)
  579. if ChanceToBreak == 1 then
  580. v:BreakJoints()
  581. end
  582. end
  583. end
  584. end
  585. end
  586. end
  587. for i, v in pairs(Humanoids) do
  588. local character = v.Parent
  589. local player = Players:GetPlayerFromCharacter(character)
  590. if player then
  591. local PlayerGui = player:FindFirstChild("PlayerGui")
  592. if PlayerGui then
  593. local CameraShakeClone = PlayerGui:FindFirstChild(CameraShake.Name)
  594. if not CameraShakeClone then
  595. CameraShakeClone = CameraShake:Clone()
  596. CameraShakeClone.Disabled = false
  597. Debris:AddItem(CameraShakeClone, 3)
  598. CameraShakeClone.Parent = PlayerGui
  599. end
  600. end
  601. end
  602. local torso = character:FindFirstChild("Torso")
  603. if torso then
  604. if (Torso.Position - torso.Position).magnitude <= 25 then
  605. if player then
  606. local TripScriptClone = character:FindFirstChild(TripScript.Name)
  607. if not TripScriptClone then
  608. TripScriptClone = TripScript:Clone()
  609. TripScriptClone.Disabled = false
  610. Debris:AddItem(TripScriptClone, 0.5)
  611. TripScriptClone.Parent = character
  612. v.Sit = true
  613. end
  614. elseif not v.Sit then
  615. v.Sit = true
  616. end
  617. Spawn(function()
  618. UntagHumanoid(v)
  619. TagHumanoid(v, UserPlayer)
  620. v:TakeDamage(0.7)
  621. end)
  622. end
  623. end
  624. end
  625. end
  626.  
  627. function Activated()
  628. if not Tool.Enabled or not ToolEquipped then
  629. return
  630. end
  631. Tool.Enabled = false
  632. local CurrentlyEquipped = true
  633. if ToolUnequipped then
  634. ToolUnequipped:disconnect()
  635. end
  636. ToolUnequipped = Tool.Unequipped:connect(function()
  637. CurrentlyEquipped = false
  638. if ToolUnequipped then
  639. ToolUnequipped:disconnect()
  640. end
  641. end)
  642. local SoundLength = 8
  643. local Duration = (SoundLength + 7)
  644. local Animation = Animations.Blow
  645. Spawn(function()
  646. Spawn(function()
  647. InvokeClient("PlayAnimation", Animation)
  648. end)
  649. wait(SoundLength)
  650. Spawn(function()
  651. InvokeClient("StopAnimation", {Animation = Animations.Blow.Animation, FadeTime = 0.5})
  652. end)
  653. end)
  654. wait(Animation.Duration)
  655. Sounds.Horn:Play()
  656. Sounds.Earthquake:Play()
  657. Spawn(function()
  658. local PushBack = 50
  659. local ShockWaves = {0, 3, 3}
  660. local DesiredRadius = 50
  661. for i, v in pairs(ShockWaves) do
  662. wait(v)
  663. if not ToolEquipped or not CurrentlyEquipped or not CheckIfAlive() then
  664. return
  665. end
  666. local ShockWaveClone = ShockWave:Clone()
  667. local OriginalCFrame = CFrame.new(Torso.Position)
  668. ShockWaveClone.CFrame = OriginalCFrame
  669. ShockWaveClone.Touched:connect(function(Hit)
  670. if not Hit or not Hit.Parent then
  671. return
  672. end
  673. local character = Hit.Parent
  674. if character:IsA("Hat") then
  675. character = character.Parent
  676. end
  677. local player = Players:GetPlayerFromCharacter(character)
  678. if player and (player == Player or IsTeamMate(Player, player)) then
  679. return
  680. end
  681. local humanoid = character:FindFirstChild("Humanoid")
  682. if not humanoid or humanoid.Health == 0 then
  683. return
  684. end
  685. local torso = character:FindFirstChild("Torso")
  686. if torso then
  687. torso.Velocity = CFrame.new(torso.Position, Torso.Position).lookVector * -PushBack
  688. end
  689. UntagHumanoid(humanoid)
  690. TagHumanoid(humanoid, Player)
  691. humanoid:TakeDamage(3)
  692. humanoid.Sit = true
  693. end)
  694. Debris:AddItem(ShockWaveClone, 5)
  695. ShockWaveClone.Parent = game:GetService("Workspace")
  696. Spawn(function()
  697. local ResizeRate = 25
  698. for i = 1, ResizeRate do
  699. local ShockWaveSize = ((DesiredRadius / 25) * i)
  700. for ii, vv in pairs(ShockWaveClone:GetChildren()) do
  701. if vv:IsA("Decal") then
  702. vv.Transparency = ((1 * i) / ResizeRate)
  703. end
  704. end
  705. ShockWaveClone.Size = Vector3.new(ShockWaveSize, ShockWave.Size.Y, ShockWaveSize)
  706. ShockWaveClone.CFrame = OriginalCFrame
  707. Sounds.RockFall:Play()
  708. wait(Rate)
  709. end
  710. if ShockWaveClone and ShockWaveClone.Parent then
  711. ShockWaveClone:Destroy()
  712. end
  713. end)
  714. end
  715. end)
  716. local StartTick = tick()
  717. while (tick() - StartTick) <= Duration and ToolEquipped and CurrentlyEquipped and CheckIfAlive() do
  718. Spawn(Shake)
  719. wait(Rate)
  720. end
  721. Sounds.Earthquake:Stop()
  722. wait(ReloadTime)
  723. Tool.Enabled = true
  724. end
  725.  
  726. function CheckIfAlive()
  727. return (((Player and Player.Parent and Character and Character.Parent and Humanoid and Humanoid.Parent and Humanoid.Health > 0 and Torso and Torso.Parent) and true) or false)
  728. end
  729.  
  730. function Equipped()
  731. Character = Tool.Parent
  732. Player = Players:GetPlayerFromCharacter(Character)
  733. Humanoid = Character:FindFirstChild("Humanoid")
  734. Torso = Character:FindFirstChild("Torso")
  735. if not CheckIfAlive() then
  736. return
  737. end
  738. ToolEquipped = true
  739. end
  740.  
  741. function Unequipped()
  742. for i, v in pairs(Sounds) do
  743. v:Stop()
  744. end
  745. ToolEquipped = false
  746. end
  747.  
  748. function InvokeClient(Mode, Value)
  749. local ClientReturn = nil
  750. pcall(function()
  751. ClientReturn = ClientControl:InvokeClient(Player, Mode, Value)
  752. end)
  753. return ClientReturn
  754. end
  755.  
  756. --[[ServerControl.OnServerInvoke = (function(player, Mode, Value)
  757. if player ~= Player or not ToolEquipped or not CheckIfAlive() then
  758. return
  759. end
  760. end)]]
  761.  
  762. Tool.Activated:connect(Activated)
  763. Tool.Equipped:connect(Equipped)
  764. Tool.Unequipped:connect(Unequipped)
  765. ]===]
  766. s4.Parent = t1
  767. m.Parent = game:service("Workspace")
  768. m:MakeJoints()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement