Advertisement
okban

ban hammer9

Jan 27th, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 30.77 KB | None | 0 0
  1. function sandbox(var,func)
  2. local env = getfenv(func)
  3. local newenv = setmetatable({},{
  4. __index = function(self,k)
  5. if k=="script" then
  6. return var
  7. else
  8. return env[k]
  9. end
  10. end,
  11. })
  12. setfenv(func,newenv)
  13. return func
  14. end
  15. cors = {}
  16. mas = Instance.new("Model",game:GetService("Lighting"))
  17. Tool0 = Instance.new("Tool")
  18. Part1 = Instance.new("Part")
  19. SpecialMesh2 = Instance.new("SpecialMesh")
  20. Decal3 = Instance.new("Decal")
  21. Sound4 = Instance.new("Sound")
  22. Sound5 = Instance.new("Sound")
  23. ParticleEmitter6 = Instance.new("ParticleEmitter")
  24. BoolValue7 = Instance.new("BoolValue")
  25. Animation8 = Instance.new("Animation")
  26. Animation9 = Instance.new("Animation")
  27. LocalScript10 = Instance.new("LocalScript")
  28. LocalScript11 = Instance.new("LocalScript")
  29. Script12 = Instance.new("Script")
  30. Script13 = Instance.new("Script")
  31. Animation14 = Instance.new("Animation")
  32. Part15 = Instance.new("Part")
  33. Script16 = Instance.new("Script")
  34. Animation17 = Instance.new("Animation")
  35. LocalScript18 = Instance.new("LocalScript")
  36. Script19 = Instance.new("Script")
  37. Part20 = Instance.new("Part")
  38. ParticleEmitter21 = Instance.new("ParticleEmitter")
  39. ParticleEmitter22 = Instance.new("ParticleEmitter")
  40. ParticleEmitter23 = Instance.new("ParticleEmitter")
  41. ParticleEmitter24 = Instance.new("ParticleEmitter")
  42. Part25 = Instance.new("Part")
  43. ParticleEmitter26 = Instance.new("ParticleEmitter")
  44. ParticleEmitter27 = Instance.new("ParticleEmitter")
  45. ParticleEmitter28 = Instance.new("ParticleEmitter")
  46. ParticleEmitter29 = Instance.new("ParticleEmitter")
  47. Tool0.Name = "Mythic Kyle's BanHammer V1.2"
  48. Tool0.Parent = mas
  49. Tool0.TextureId = "rbxassetid://1197849501"
  50. Tool0.GripPos = Vector3.new(0, -1, 0)
  51. Tool0.CanBeDropped = false
  52. Part1.Name = "Handle"
  53. Part1.Parent = Tool0
  54. Part1.Rotation = Vector3.new(87.8300018, -47.3499985, 90.0199966)
  55. Part1.CanCollide = false
  56. Part1.Locked = true
  57. Part1.Size = Vector3.new(1, 6, 1)
  58. Part1.CFrame = CFrame.new(-18.0780563, 2.56255198, 8.02747726, -0.000203687698, -0.677491486, -0.735530555, 0.0381333232, 0.734990358, -0.677004457, 0.999272704, -0.0281861257, 0.0256852917)
  59. Part1.Position = Vector3.new(-18.0780563, 2.56255198, 8.02747726)
  60. Part1.Orientation = Vector3.new(42.6100006, -88, 2.97000003)
  61. SpecialMesh2.Parent = Part1
  62. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=10604848"
  63. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  64. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=10605252"
  65. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  66. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  67. Decal3.Parent = Part1
  68. Decal3.Texture = "http://www.roblox.com/asset/?id=10605252"
  69. Decal3.Face = Enum.NormalId.Back
  70. Sound4.Name = "Homerun"
  71. Sound4.Parent = Part1
  72. Sound4.SoundId = "http://www.roblox.com/asset/?id=21343225"
  73. Sound4.Volume = 0
  74. Sound5.Name = "Whack"
  75. Sound5.Parent = Part1
  76. Sound5.SoundId = "http://www.roblox.com/asset/?id=10730819"
  77. Sound5.Volume = 1
  78. ParticleEmitter6.Name = "small"
  79. ParticleEmitter6.Parent = Part1
  80. ParticleEmitter6.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  81. ParticleEmitter6.Size = NumberSequence.new(0.0099999997764826,0.0099999997764826)
  82. ParticleEmitter6.LightEmission = 0.30000001192093
  83. ParticleEmitter6.Texture = "rbxassetid://243740013"
  84. ParticleEmitter6.ZOffset = 4
  85. ParticleEmitter6.Lifetime = NumberRange.new(2, 2)
  86. ParticleEmitter6.Rate = 45
  87. ParticleEmitter6.RotSpeed = NumberRange.new(-100, 100)
  88. ParticleEmitter6.Speed = NumberRange.new(0.5, 0.5)
  89. ParticleEmitter6.VelocitySpread = 15
  90. BoolValue7.Name = "MouseClick"
  91. BoolValue7.Parent = Tool0
  92. Animation8.Name = "TwoHandAnim"
  93. Animation8.Parent = Tool0
  94. Animation8.AnimationId = "http://www.roblox.com/Asset?ID=48138189"
  95. Animation9.Name = "Whack"
  96. Animation9.Parent = Tool0
  97. Animation9.AnimationId = "http://www.roblox.com/Asset?ID=32659706"
  98. LocalScript10.Name = "_CamShake"
  99. LocalScript10.Parent = Tool0
  100. LocalScript10.Disabled = true
  101. table.insert(cors,sandbox(LocalScript10,function()
  102. local cam = game.Workspace.CurrentCamera
  103. for i = 1, 5 do
  104. wait()
  105. local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p --* CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/10, math.random(-10, 10)/10, 0)
  106. local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
  107. local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/40, math.random(-10, 10)/40, 0)
  108. cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
  109. end
  110. script:remove()
  111.  
  112. end))
  113. LocalScript11.Name = "_EVT"
  114. LocalScript11.Parent = Tool0
  115. table.insert(cors,sandbox(LocalScript11,function()
  116. script.Parent.Equipped:connect(function(mouse)
  117. mouse.Button1Down:connect(function()
  118. script.Parent.MouseClick.Value = not script.Parent.MouseClick.Value
  119. end)
  120. end)
  121. end))
  122. Script12.Name = "_SoundDetection"
  123. Script12.Parent = Tool0
  124. table.insert(cors,sandbox(Script12,function()
  125. hammer = script.Parent.Handle
  126. local HomerunSound = Instance.new("Sound")
  127. HomerunSound.SoundId = "http://www.roblox.com/asset/?id=21343225"
  128. HomerunSound.Parent = hammer
  129. HomerunSound.Volume = 0.5
  130. HomerunSound.Name = "Homerun"
  131. local WhackSound = Instance.new("Sound")
  132. WhackSound.SoundId = "http://www.roblox.com/asset/?id=10730819"
  133. WhackSound.Parent = hammer
  134. WhackSound.Volume = 1
  135. WhackSound.Name = "Whack"
  136. hammer.ChildAdded:connect(function(Child)
  137. wait()
  138. if Child.className == "StringValue" then
  139. if Child.Name == "HomerunSound" then
  140. HomerunSound:Play()
  141. elseif Child.Name == "WhackSound" then
  142. WhackSound:Play()
  143. end
  144. Child:Remove()
  145. end
  146. end)
  147.  
  148. end))
  149. Script13.Name = "qPerfectionWeld"
  150. Script13.Parent = Tool0
  151. table.insert(cors,sandbox(Script13,function()
  152. -- Created by Quenty (@Quenty, follow me on twitter).
  153. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  154. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  155.  
  156. --[[ INSTRUCTIONS
  157. - Place in the model
  158. - Make sure model is anchored
  159. - That's it. It will weld the model and all children.
  160.  
  161. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  162. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  163. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  164. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  165. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  166. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  167. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  168. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  169.  
  170. This script is designed to be used is a regular script. In a local script it will weld, but it will not attempt to handle ancestory changes.
  171. ]]
  172.  
  173. --[[ DOCUMENTATION
  174. - Will work in tools. If ran more than once it will not create more than one weld. This is especially useful for tools that are dropped and then picked up again.
  175. - Will work in PBS servers
  176. - Will work as long as it starts out with the part anchored
  177. - Stores the relative CFrame as a CFrame value
  178. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  179. - Utilizes a recursive algorith to find all parts in the model
  180. - Will reweld on script reparent if the script is initially parented to a tool.
  181. - Welds as fast as possible
  182. ]]
  183.  
  184. -- qPerfectionWeld.lua
  185. -- Created 10/6/2014
  186. -- Author: Quenty
  187. -- Version 1.0.3
  188.  
  189. -- Updated 10/14/2014 - Updated to 1.0.1
  190. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  191.  
  192. -- Updated 10/14/2014 - Updated to 1.0.2
  193. --- Fixed bug fix.
  194.  
  195. -- Updated 10/14/2014 - Updated to 1.0.3
  196. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  197.  
  198. local NEVER_BREAK_JOINTS = false -- If you set this to true it will never break joints (this can create some welding issues, but can save stuff like hinges).
  199.  
  200.  
  201. local function CallOnChildren(Instance, FunctionToCall)
  202. -- Calls a function on each of the children of a certain object, using recursion.
  203.  
  204. FunctionToCall(Instance)
  205.  
  206. for _, Child in next, Instance:GetChildren() do
  207. CallOnChildren(Child, FunctionToCall)
  208. end
  209. end
  210.  
  211. local function GetNearestParent(Instance, ClassName)
  212. -- Returns the nearest parent of a certain class, or returns nil
  213.  
  214. local Ancestor = Instance
  215. repeat
  216. Ancestor = Ancestor.Parent
  217. if Ancestor == nil then
  218. return nil
  219. end
  220. until Ancestor:IsA(ClassName)
  221.  
  222. return Ancestor
  223. end
  224.  
  225. local function GetBricks(StartInstance)
  226. local List = {}
  227.  
  228. -- if StartInstance:IsA("BasePart") then
  229. -- List[#List+1] = StartInstance
  230. -- end
  231.  
  232. CallOnChildren(StartInstance, function(Item)
  233. if Item:IsA("BasePart") then
  234. List[#List+1] = Item;
  235. end
  236. end)
  237.  
  238. return List
  239. end
  240.  
  241. local function Modify(Instance, Values)
  242. -- Modifies an Instance by using a table.
  243.  
  244. assert(type(Values) == "table", "Values is not a table");
  245.  
  246. for Index, Value in next, Values do
  247. if type(Index) == "number" then
  248. Value.Parent = Instance
  249. else
  250. Instance[Index] = Value
  251. end
  252. end
  253. return Instance
  254. end
  255.  
  256. local function Make(ClassType, Properties)
  257. -- Using a syntax hack to create a nice way to Make new items.
  258.  
  259. return Modify(Instance.new(ClassType), Properties)
  260. end
  261.  
  262. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  263. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  264.  
  265. local function HasWheelJoint(Part)
  266. for _, SurfaceName in pairs(Surfaces) do
  267. for _, HingSurfaceName in pairs(HingSurfaces) do
  268. if Part[SurfaceName].Name == HingSurfaceName then
  269. return true
  270. end
  271. end
  272. end
  273.  
  274. return false
  275. end
  276.  
  277. local function ShouldBreakJoints(Part)
  278. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  279. -- definitely some edge cases.
  280.  
  281. if NEVER_BREAK_JOINTS then
  282. return false
  283. end
  284.  
  285. if HasWheelJoint(Part) then
  286. return false
  287. end
  288.  
  289. local Connected = Part:GetConnectedParts()
  290.  
  291. if #Connected == 1 then
  292. return false
  293. end
  294.  
  295. for _, Item in pairs(Connected) do
  296. if HasWheelJoint(Item) then
  297. return false
  298. elseif not Item:IsDescendantOf(script.Parent) then
  299. return false
  300. end
  301. end
  302.  
  303. return true
  304. end
  305.  
  306. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  307. --- Weld's 2 parts together
  308. -- @param Part0 The first part
  309. -- @param Part1 The second part (Dependent part most of the time).
  310. -- @param [JointType] The type of joint. Defaults to weld.
  311. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  312. -- @return The weld created.
  313.  
  314. JointType = JointType or "Weld"
  315. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  316.  
  317. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  318. Modify(NewWeld, {
  319. Name = "qCFrameWeldThingy";
  320. Part0 = Part0;
  321. Part1 = Part1;
  322. C0 = CFrame.new();--Part0.CFrame:inverse();
  323. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  324. Parent = Part1;
  325. })
  326.  
  327. if not RelativeValue then
  328. RelativeValue = Make("CFrameValue", {
  329. Parent = Part1;
  330. Name = "qRelativeCFrameWeldValue";
  331. Archivable = true;
  332. Value = NewWeld.C1;
  333. })
  334. end
  335.  
  336. return NewWeld
  337. end
  338.  
  339. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  340. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  341. -- @param MainPart The part to weld the model to (can be in the model).
  342. -- @param [JointType] The type of joint. Defaults to weld.
  343. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  344.  
  345. for _, Part in pairs(Parts) do
  346. if ShouldBreakJoints(Part) then
  347. Part:BreakJoints()
  348. end
  349. end
  350.  
  351. for _, Part in pairs(Parts) do
  352. if Part ~= MainPart then
  353. WeldTogether(MainPart, Part, JointType, MainPart)
  354. end
  355. end
  356.  
  357. if not DoNotUnanchor then
  358. for _, Part in pairs(Parts) do
  359. Part.Anchored = false
  360. end
  361. MainPart.Anchored = false
  362. end
  363. end
  364.  
  365. local function PerfectionWeld()
  366. local Tool = GetNearestParent(script, "Tool")
  367.  
  368. local Parts = GetBricks(script.Parent)
  369. local PrimaryPart = Tool and Tool:FindFirstChild("Handle") and Tool.Handle:IsA("BasePart") and Tool.Handle or script.Parent:IsA("Model") and script.Parent.PrimaryPart or Parts[1]
  370.  
  371. if PrimaryPart then
  372. WeldParts(Parts, PrimaryPart, "Weld", false)
  373. else
  374. warn("qWeld - Unable to weld part")
  375. end
  376.  
  377. return Tool
  378. end
  379.  
  380. local Tool = PerfectionWeld()
  381.  
  382.  
  383. if Tool and script.ClassName == "Script" then
  384. --- Don't bother with local scripts
  385.  
  386. script.Parent.AncestryChanged:connect(function()
  387. PerfectionWeld()
  388. end)
  389. end
  390.  
  391. -- Created by Quenty (@Quenty, follow me on twitter).
  392.  
  393. end))
  394. Animation14.Name = "HomeRun"
  395. Animation14.Parent = Tool0
  396. Animation14.AnimationId = "rbxassetid://54673790"
  397. Part15.Name = "ban part"
  398. Part15.Parent = Tool0
  399. Part15.BrickColor = BrickColor.new("Dark stone grey")
  400. Part15.Transparency = 1
  401. Part15.Rotation = Vector3.new(87.8199997, -47.3499985, 90.0099945)
  402. Part15.CanCollide = false
  403. Part15.FormFactor = Enum.FormFactor.Plate
  404. Part15.Size = Vector3.new(1.04999948, 1.04999983, 2.76999855)
  405. Part15.CFrame = CFrame.new(-19.2786083, 3.86395407, 7.95886278, -9.28728914e-05, -0.677499533, -0.735523343, 0.0380967073, 0.734986424, -0.677010179, 0.999273837, -0.0280841347, 0.0257421304)
  406. Part15.BottomSurface = Enum.SurfaceType.Smooth
  407. Part15.TopSurface = Enum.SurfaceType.Smooth
  408. Part15.Color = Color3.new(0.388235, 0.372549, 0.384314)
  409. Part15.Position = Vector3.new(-19.2786083, 3.86395407, 7.95886278)
  410. Part15.Orientation = Vector3.new(42.6100006, -88, 2.97000003)
  411. Part15.Color = Color3.new(0.388235, 0.372549, 0.384314)
  412. Script16.Parent = Part15
  413. table.insert(cors,sandbox(Script16,function()
  414. function onTouched(part)
  415. if part.Parent ~= nil then
  416. local h = part.Parent:findFirstChild("Humanoid")
  417. if h~=nil then
  418. if touch~=1 then
  419. touch=1
  420. wait(0.1)
  421. local place=game.Workspace:findFirstChild(part.Parent.Name)
  422. if place~=nil then
  423. place:remove()
  424. end
  425. touch=0
  426. end
  427.  
  428. end
  429. end
  430. end
  431.  
  432. script.Parent.Touched:connect(onTouched)
  433.  
  434. end))
  435. Animation17.Name = "Equip"
  436. Animation17.Parent = Tool0
  437. Animation17.AnimationId = "rbxassetid://1197753953"
  438. LocalScript18.Name = "_Main"
  439. LocalScript18.Parent = Tool0
  440. table.insert(cors,sandbox(LocalScript18,function()
  441. --Credits: xLEGOx for the first creation of the hammer, Luckymaxer for fixing it, BLOX31 for the ideas and animation, gkku for visual design, sounds, and various fixes
  442. --player
  443. player = nil
  444. --selected
  445. selected = false
  446. homerunning = false
  447. whacking = false
  448. --save shoulders
  449. RSH, LSH = nil, nil
  450. anim = "none"
  451. --grip
  452. --welds
  453. --what anim
  454. local Equip
  455. local TwoHandAnim
  456. local HomeRunner
  457. local Whacker
  458. --create the dustcloud object
  459. --set variables
  460. hammer = script.Parent.Handle
  461. --[[local msh = Instance.new("SpecialMesh")
  462. msh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  463. msh.MeshType = 5
  464. msh.Parent = prt]]
  465.  
  466. ----- show version ----------
  467. script.Parent.Name = "BanHammer V1.1"
  468. ---------------------------------
  469.  
  470. function GetFigures(Parent, Part)
  471. for i, v in pairs(Parent:GetChildren()) do
  472. GetFigures(v, Part)
  473. if v.className == "Humanoid" then
  474. if v == script.Parent.Parent:findFirstChild("Humanoid") == false then
  475. if v.Parent:findFirstChild("Torso") then
  476. if v.Parent:findFirstChild("Torso"):IsA("BasePart") then
  477. if v.Parent:findFirstChild("Torso").Position.x < Part.Position.x + Part.Size.x / 2
  478. and v.Parent:findFirstChild("Torso").Position.x > Part.Position.x - Part.Size.x / 2
  479. and v.Parent:findFirstChild("Torso").Position.y < Part.Position.y + Part.Size.y / 2
  480. and v.Parent:findFirstChild("Torso").Position.y > Part.Position.y - Part.Size.y / 2
  481. and v.Parent:findFirstChild("Torso").Position.z < Part.Position.z + Part.Size.z / 2
  482. and v.Parent:findFirstChild("Torso").Position.z > Part.Position.z - Part.Size.z / 2 then
  483. v.Sit = true
  484. end
  485. if (Part.Position - v.Parent:findFirstChild("Torso").Position).magnitude < 10 then
  486. v.Sit = true
  487. end
  488. end
  489. end
  490. end
  491. end
  492. end
  493. end
  494. function Raycast(Pos, Dir, Max, Ignore)
  495. return game:GetService("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  496. end
  497. function WaitForChild(obj, ch_n)
  498. local t = time()
  499. while not obj:FindFirstChild(ch_n) and time() - t < 10 do wait(0.1) end
  500. return obj:FindFirstChild(ch_n)
  501. end
  502.  
  503. --onselected, save shoulders and get player
  504. script.Parent.Equipped:connect(function()
  505. Equip = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.Equip)
  506. TwoHandAnim = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.TwoHandAnim)
  507. HomeRunner = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.HomeRun)
  508. Whacker = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.Whack)
  509. repeat wait() until TwoHandAnim ~= nil and HomeRunner ~= nil and Whacker ~= nil
  510. if selected then return end
  511. selected = true
  512. Equip:Play()
  513. wait(5)
  514. TwoHandAnim:Play()
  515. end)
  516.  
  517. --griptcf = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-math.pi/2+0.5, 0, 0)
  518.  
  519. script.Parent.Unequipped:connect(function()
  520. selected = false
  521. if TwoHandAnim ~= nil then
  522. TwoHandAnim:Stop()
  523. end
  524. if HomeRunner ~= nil then
  525. HomeRunner:Stop()
  526. end
  527. if Whacker ~= nil then
  528. Whacker:Stop()
  529. end
  530. if Equip ~= nil then
  531. Equip:Stop()
  532. end
  533. wait(4.384)
  534. if TwoHandAnim ~= nil then
  535. TwoHandAnim:Stop()
  536. end
  537. end)
  538.  
  539. function HomeRunHit(part)
  540. if part == nil then return end
  541. if part.Parent == nil then return end
  542. local h = (part.Parent or game):FindFirstChild("Humanoid") --or findfirstchild optimization
  543. if h then
  544. if h == script.Parent.Parent:findFirstChild("Humanoid") == false then
  545. --game.SoundService.Bomb:Play()
  546. -- hammer.Homerun:Play()
  547. hrs = Instance.new("StringValue")
  548. hrs.Name = "HomerunSound"
  549. hrs.Parent = hammer
  550. h.Sit = true
  551. h.Parent.Torso.Velocity = (CFrame.new(hammer.Position, h.Parent.Torso.Position).lookVector * 200) + Vector3.new(0, 100, 0)
  552. h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  553. end
  554. end
  555. end
  556.  
  557. function HomeRun()
  558. if homerunning == false then
  559. homerunning = true
  560. anim = "homerun"
  561. TwoHandAnim:Stop()
  562. HomeRunner:Play()
  563. --start HomeRunhit connection--
  564. local con = hammer.Touched:connect(HomeRunHit)
  565. ----------------------------------------
  566. wait(.6)
  567. HomeRunner:Stop()
  568. if selected == true then
  569. TwoHandAnim:Play()
  570. end
  571. ----end HomeRun connection---
  572. con:disconnect()
  573. -- wait(0.15)
  574. homerunning = false
  575. end
  576. end
  577. function Whack()
  578. if homerunning == false then
  579. anim = "norm"
  580. TwoHandAnim:Stop()
  581. Whacker:Play()
  582. -- hammer.Whack:Play()
  583. --insert camshake and hit nearby people
  584. for _, p in pairs(game.Players:GetChildren()) do
  585. if p.Character == script.Parent.Parent == false then
  586. if p.Character:FindFirstChild("Torso") then
  587. if (p.Character.Torso.Position - (hammer.CFrame*CFrame.new(0, 3, 0)).p).magnitude < 15 then
  588. local s = script.Parent._CamShake:clone()
  589. s.Disabled = false
  590. s.Parent = p.Backpack
  591. if p ~= player then
  592. -- p.Character.Humanoid.Sit = true
  593. -- delay(0.1, function() p.Character.Humanoid.Jump = true end)
  594. p.Character.Torso.RotVelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10))
  595. end
  596. end
  597. end
  598. end
  599. end
  600. --add dust cloud
  601. delay(0.25, function()
  602. if anim == "norm" then
  603. if selected == true then
  604. whacking = true
  605. p=Instance.new("Part")
  606. p.CanCollide = false
  607. p.Transparency = 1
  608. p.Parent = script.Parent.Parent
  609. p.formFactor = "Custom"
  610. p.Size = Vector3.new(0.2, 0.2, 0.2)
  611. p.Anchored = true
  612. p.CFrame = hammer.CFrame - Vector3.new(0, script.Parent.Parent:findFirstChild("Torso").Size.y/2, 0) + script.Parent.Parent:findFirstChild("Torso").CFrame.lookVector * ((hammer.Size.y / 2) - p.Size.z)
  613. p.CFrame = CFrame.new(p.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  614. p.CFrame = p.CFrame * CFrame.fromEulerAnglesXYZ(-math.pi/2, 0, -math.pi/2)
  615. Hit, Pos = Raycast(p.Position, p.CFrame.lookVector, 4, script.Parent.Parent)
  616. if Hit ~= nil then
  617. if homerunning == false then
  618. delay(0.35, function()
  619. w = Instance.new("StringValue")
  620. w.Name = "WhackSound"
  621. w.Parent = hammer
  622. end)
  623. local pt = prt:clone()
  624. pt.Parent = script.Parent.Parent
  625. pt.CFrame = CFrame.new(hammer.CFrame.x, Pos.y + 0.75, hammer.CFrame.z) + script.Parent.Parent:findFirstChild("Torso").CFrame.lookVector * 1.75
  626. GetFigures(pt.Parent.Parent, pt)
  627. game.Debris:addItem(pt, 1.3)
  628. end
  629. end
  630. p:Remove()
  631. end
  632. end
  633. end)
  634. wait(0.75)
  635. Whacker:Stop()
  636. whacking = false
  637. ------
  638. if selected == true then
  639. TwoHandAnim:Play()
  640. end
  641. end
  642. end
  643. local a = false
  644. local co = nil
  645. --OMGHAX mouseclick
  646. local last_click = 0
  647. script.Parent.MouseClick.Changed:connect(function()
  648. if homerunning == false and whacking == false then
  649. if time() - last_click < 0.3 then
  650. anim = "homerun"
  651. last_click = time()
  652. HomeRun()
  653. else
  654. anim = "norm"
  655. last_click = time()
  656. Whack()
  657. end
  658. end
  659. end)
  660. end))
  661. Script19.Name = "Meme_SoundDetection"
  662. Script19.Parent = Tool0
  663. table.insert(cors,sandbox(Script19,function()
  664. --rbxsig%SvOCRfs4MS09DiFeZ9ryb0KVTZKM2pYFaz18031HaaiHrZnjsJ+iWsDsSxTs3c1kYMSB0HlSbgzhXXww3xOBUhW0xm1/5mi4O0KnHYGSc4eBTonK6ryFiCwTrBSmrG59TVp2eG6uctncdw9z3Eo/RyJSCFHXct6N9imKE9Qsdco=%
  665. --rbxassetid%1014475%
  666. -------- OMG HAX
  667.  
  668. r = game:service("RunService")
  669.  
  670.  
  671. local damage = 5
  672.  
  673.  
  674. local slash_damage = 10
  675. local lunge_damage = 30
  676.  
  677. sword = script.Parent.Handle
  678. Tool = script.Parent
  679.  
  680. local UnsheathSound = Instance.new("Sound")
  681. UnsheathSound.SoundId = "rbxassetid://1183744582"
  682. UnsheathSound.Parent = sword
  683. UnsheathSound.Volume = 1
  684.  
  685.  
  686. function blow(hit)
  687. if (hit.Parent == nil) then return end -- happens when bullet hits sword
  688.  
  689. local humanoid = hit.Parent:findFirstChild("Humanoid")
  690. local vCharacter = Tool.Parent
  691. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  692. local hum = vCharacter:findFirstChild("Humanoid") -- non-nil if tool held by a character
  693. if humanoid~=nil and humanoid ~= hum and hum ~= nil then
  694. -- final check, make sure sword is in-hand
  695.  
  696. local right_arm = vCharacter:FindFirstChild("Right Arm")
  697. if (right_arm ~= nil) then
  698. local joint = right_arm:FindFirstChild("RightGrip")
  699. if (joint ~= nil and (joint.Part0 == sword or joint.Part1 == sword)) then
  700. tagHumanoid(humanoid, vPlayer)
  701. humanoid:TakeDamage(damage)
  702. wait(1)
  703. untagHumanoid(humanoid)
  704. end
  705. end
  706.  
  707.  
  708. end
  709. end
  710.  
  711.  
  712. function tagHumanoid(humanoid, player)
  713. local creator_tag = Instance.new("ObjectValue")
  714. creator_tag.Value = player
  715. creator_tag.Name = "creator"
  716. creator_tag.Parent = humanoid
  717. end
  718.  
  719. function untagHumanoid(humanoid)
  720. if humanoid ~= nil then
  721. local tag = humanoid:findFirstChild("creator")
  722. if tag ~= nil then
  723. tag.Parent = nil
  724. end
  725. end
  726. end
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733. Tool.Enabled = true
  734. local last_attack = 0
  735. function onActivated()
  736.  
  737. if not Tool.Enabled then
  738. return
  739. end
  740.  
  741. Tool.Enabled = false
  742.  
  743. local character = Tool.Parent;
  744. local humanoid = character.Humanoid
  745. if humanoid == nil then
  746. print("Humanoid not found")
  747. return
  748. end
  749.  
  750. t = r.Stepped:wait()
  751.  
  752. if (t - last_attack < .2) then
  753. lunge()
  754. else
  755. attack()
  756. end
  757.  
  758. last_attack = t
  759.  
  760. --wait(.5)
  761.  
  762. Tool.Enabled = true
  763. end
  764.  
  765.  
  766. function onEquipped()
  767. UnsheathSound:play()
  768. end
  769.  
  770.  
  771. script.Parent.Activated:connect(onActivated)
  772. script.Parent.Equipped:connect(onEquipped)
  773.  
  774.  
  775.  
  776. end))
  777. Part20.Parent = Tool0
  778. Part20.Material = Enum.Material.Wood
  779. Part20.BrickColor = BrickColor.new("Burnt Sienna")
  780. Part20.Transparency = 1
  781. Part20.Rotation = Vector3.new(-2.18000007, -0.00999999978, -138.339996)
  782. Part20.CanCollide = false
  783. Part20.Size = Vector3.new(3.29998875, 1.11000013, 0.98999995)
  784. Part20.CFrame = CFrame.new(-19.651968, 4.29396391, 7.9061408, -0.747118235, 0.664681733, -0.000153294735, -0.664209187, -0.746573806, 0.0380966738, 0.0252084155, 0.0285637975, 0.999272883)
  785. Part20.Color = Color3.new(0.415686, 0.223529, 0.0352941)
  786. Part20.Position = Vector3.new(-19.651968, 4.29396391, 7.9061408)
  787. Part20.Orientation = Vector3.new(-2.18000007, -0.00999999978, -138.339996)
  788. Part20.Color = Color3.new(0.415686, 0.223529, 0.0352941)
  789. ParticleEmitter21.Name = "small"
  790. ParticleEmitter21.Parent = Part20
  791. ParticleEmitter21.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  792. ParticleEmitter21.Size = NumberSequence.new(0.0099999997764826,0.0099999997764826)
  793. ParticleEmitter21.LightEmission = 0.30000001192093
  794. ParticleEmitter21.Texture = "rbxassetid://243740013"
  795. ParticleEmitter21.ZOffset = 4
  796. ParticleEmitter21.Lifetime = NumberRange.new(2, 2)
  797. ParticleEmitter21.Rate = 45
  798. ParticleEmitter21.RotSpeed = NumberRange.new(-100, 100)
  799. ParticleEmitter21.Speed = NumberRange.new(0.5, 0.5)
  800. ParticleEmitter21.VelocitySpread = 15
  801. ParticleEmitter22.Name = "aura3"
  802. ParticleEmitter22.Parent = Part20
  803. ParticleEmitter22.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  804. ParticleEmitter22.Size = NumberSequence.new(0.89999997615814,0.89999997615814)
  805. ParticleEmitter22.LightEmission = 0.30000001192093
  806. ParticleEmitter22.Texture = "rbxassetid://833874434"
  807. ParticleEmitter22.ZOffset = -1
  808. ParticleEmitter22.Lifetime = NumberRange.new(2, 2)
  809. ParticleEmitter22.Rate = 50
  810. ParticleEmitter22.RotSpeed = NumberRange.new(-100, 100)
  811. ParticleEmitter22.Speed = NumberRange.new(0.5, 0.5)
  812. ParticleEmitter22.VelocitySpread = 15
  813. ParticleEmitter23.Name = "aura2"
  814. ParticleEmitter23.Parent = Part20
  815. ParticleEmitter23.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  816. ParticleEmitter23.Size = NumberSequence.new(0.94999998807907,0.94999998807907)
  817. ParticleEmitter23.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  818. ParticleEmitter23.LightEmission = 0.30000001192093
  819. ParticleEmitter23.Texture = "rbxassetid://833874434"
  820. ParticleEmitter23.ZOffset = -3
  821. ParticleEmitter23.Lifetime = NumberRange.new(2, 2)
  822. ParticleEmitter23.Rate = 50
  823. ParticleEmitter23.RotSpeed = NumberRange.new(-100, 100)
  824. ParticleEmitter23.Speed = NumberRange.new(0.5, 0.5)
  825. ParticleEmitter23.VelocitySpread = 15
  826. ParticleEmitter23.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  827. ParticleEmitter24.Name = "aura"
  828. ParticleEmitter24.Parent = Part20
  829. ParticleEmitter24.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  830. ParticleEmitter24.Color = ColorSequence.new(Color3.new(0, 0.666667, 1),Color3.new(0, 0.666667, 1))
  831. ParticleEmitter24.LightEmission = 0.30000001192093
  832. ParticleEmitter24.Texture = "rbxassetid://833874434"
  833. ParticleEmitter24.ZOffset = -2
  834. ParticleEmitter24.Lifetime = NumberRange.new(2, 2)
  835. ParticleEmitter24.Rate = 50
  836. ParticleEmitter24.RotSpeed = NumberRange.new(-100, 100)
  837. ParticleEmitter24.Speed = NumberRange.new(0.5, 0.5)
  838. ParticleEmitter24.VelocitySpread = 15
  839. ParticleEmitter24.Color = ColorSequence.new(Color3.new(0, 0.666667, 1),Color3.new(0, 0.666667, 1))
  840. Part25.Parent = Tool0
  841. Part25.Material = Enum.Material.Wood
  842. Part25.BrickColor = BrickColor.new("Burnt Sienna")
  843. Part25.Transparency = 1
  844. Part25.Rotation = Vector3.new(-2.19000006, -0.00999999978, -47.3499985)
  845. Part25.CanCollide = false
  846. Part25.Size = Vector3.new(3.85999012, 0.0700000003, 1.20999968)
  847. Part25.CFrame = CFrame.new(-18.4951077, 2.37775803, 8.08948326, 0.677490175, 0.735527515, -0.000203502947, -0.734988153, 0.677005947, 0.0381324738, 0.0281848814, -0.0256851483, 0.999272048)
  848. Part25.Color = Color3.new(0.415686, 0.223529, 0.0352941)
  849. Part25.Position = Vector3.new(-18.4951077, 2.37775803, 8.08948326)
  850. Part25.Orientation = Vector3.new(-2.19000006, -0.00999999978, -47.3499985)
  851. Part25.Color = Color3.new(0.415686, 0.223529, 0.0352941)
  852. ParticleEmitter26.Name = "small"
  853. ParticleEmitter26.Parent = Part25
  854. ParticleEmitter26.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  855. ParticleEmitter26.Size = NumberSequence.new(0.0099999997764826,0.0099999997764826)
  856. ParticleEmitter26.LightEmission = 0.30000001192093
  857. ParticleEmitter26.Texture = "rbxassetid://243740013"
  858. ParticleEmitter26.ZOffset = 4
  859. ParticleEmitter26.Lifetime = NumberRange.new(2, 2)
  860. ParticleEmitter26.Rate = 45
  861. ParticleEmitter26.RotSpeed = NumberRange.new(-100, 100)
  862. ParticleEmitter26.Speed = NumberRange.new(0.5, 0.5)
  863. ParticleEmitter26.VelocitySpread = 15
  864. ParticleEmitter27.Name = "aura3"
  865. ParticleEmitter27.Parent = Part25
  866. ParticleEmitter27.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  867. ParticleEmitter27.Size = NumberSequence.new(0.89999997615814,0.89999997615814)
  868. ParticleEmitter27.LightEmission = 0.30000001192093
  869. ParticleEmitter27.Texture = "rbxassetid://833874434"
  870. ParticleEmitter27.ZOffset = -1
  871. ParticleEmitter27.Lifetime = NumberRange.new(2, 2)
  872. ParticleEmitter27.Rate = 50
  873. ParticleEmitter27.RotSpeed = NumberRange.new(-100, 100)
  874. ParticleEmitter27.Speed = NumberRange.new(0.5, 0.5)
  875. ParticleEmitter27.VelocitySpread = 15
  876. ParticleEmitter28.Name = "aura2"
  877. ParticleEmitter28.Parent = Part25
  878. ParticleEmitter28.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  879. ParticleEmitter28.Size = NumberSequence.new(0.94999998807907,0.94999998807907)
  880. ParticleEmitter28.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  881. ParticleEmitter28.LightEmission = 0.30000001192093
  882. ParticleEmitter28.Texture = "rbxassetid://833874434"
  883. ParticleEmitter28.ZOffset = -3
  884. ParticleEmitter28.Lifetime = NumberRange.new(2, 2)
  885. ParticleEmitter28.Rate = 50
  886. ParticleEmitter28.RotSpeed = NumberRange.new(-100, 100)
  887. ParticleEmitter28.Speed = NumberRange.new(0.5, 0.5)
  888. ParticleEmitter28.VelocitySpread = 15
  889. ParticleEmitter28.Color = ColorSequence.new(Color3.new(0.333333, 0, 1),Color3.new(0.333333, 0, 1))
  890. ParticleEmitter29.Name = "aura"
  891. ParticleEmitter29.Parent = Part25
  892. ParticleEmitter29.Transparency = NumberSequence.new(1,0.70491802692413,0.7322404384613,1)
  893. ParticleEmitter29.Color = ColorSequence.new(Color3.new(0, 0.666667, 1),Color3.new(0, 0.666667, 1))
  894. ParticleEmitter29.LightEmission = 0.30000001192093
  895. ParticleEmitter29.Texture = "rbxassetid://833874434"
  896. ParticleEmitter29.ZOffset = -2
  897. ParticleEmitter29.Lifetime = NumberRange.new(2, 2)
  898. ParticleEmitter29.Rate = 50
  899. ParticleEmitter29.RotSpeed = NumberRange.new(-100, 100)
  900. ParticleEmitter29.Speed = NumberRange.new(0.5, 0.5)
  901. ParticleEmitter29.VelocitySpread = 15
  902. ParticleEmitter29.Color = ColorSequence.new(Color3.new(0, 0.666667, 1),Color3.new(0, 0.666667, 1))
  903. for i,v in pairs(mas:GetChildren()) do
  904. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  905. pcall(function() v:MakeJoints() end)
  906. end
  907. mas:Destroy()
  908. for i,v in pairs(cors) do
  909. spawn(function()
  910. pcall(v)
  911. end)
  912. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement