Advertisement
okban

ban hammer 2.1

Sep 24th, 2017
18
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 21.04 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. BoolValue6 = Instance.new("BoolValue")
  24. Animation7 = Instance.new("Animation")
  25. Animation8 = Instance.new("Animation")
  26. LocalScript9 = Instance.new("LocalScript")
  27. LocalScript10 = Instance.new("LocalScript")
  28. Script11 = Instance.new("Script")
  29. LocalScript12 = Instance.new("LocalScript")
  30. Script13 = Instance.new("Script")
  31. Animation14 = Instance.new("Animation")
  32. Part15 = Instance.new("Part")
  33. Script16 = Instance.new("Script")
  34. Part17 = Instance.new("Part")
  35. Script18 = Instance.new("Script")
  36. Tool0.Name = "Kyle's BanHammer V1.2"
  37. Tool0.Parent = mas
  38. Tool0.TextureId = "http://www.roblox.com/asset/?id=10684453"
  39. Tool0.GripPos = Vector3.new(0, -1, 0)
  40. Tool0.CanBeDropped = false
  41. Part1.Name = "Handle"
  42. Part1.Parent = Tool0
  43. Part1.Rotation = Vector3.new(87.8300018, -47.3499985, 90.0199966)
  44. Part1.Locked = true
  45. Part1.Size = Vector3.new(1, 6, 1)
  46. Part1.CFrame = CFrame.new(-41.6380539, 2.56255198, -8.55249786, -0.000203687698, -0.677491486, -0.735530555, 0.0381333232, 0.734990358, -0.677004457, 0.999272704, -0.0281861257, 0.0256852917)
  47. Part1.Position = Vector3.new(-41.6380539, 2.56255198, -8.55249786)
  48. Part1.Orientation = Vector3.new(42.6100006, -88, 2.97000003)
  49. SpecialMesh2.Parent = Part1
  50. SpecialMesh2.MeshId = "http://www.roblox.com/asset/?id=10604848"
  51. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  52. SpecialMesh2.TextureId = "http://www.roblox.com/asset/?id=10605252"
  53. SpecialMesh2.MeshType = Enum.MeshType.FileMesh
  54. SpecialMesh2.Scale = Vector3.new(0.5, 0.5, 0.5)
  55. Decal3.Parent = Part1
  56. Decal3.Texture = "http://www.roblox.com/asset/?id=10605252"
  57. Decal3.Face = Enum.NormalId.Back
  58. Sound4.Name = "Homerun"
  59. Sound4.Parent = Part1
  60. Sound4.SoundId = "http://www.roblox.com/asset/?id=21343225"
  61. Sound4.Volume = 0
  62. Sound5.Name = "Whack"
  63. Sound5.Parent = Part1
  64. Sound5.SoundId = "http://www.roblox.com/asset/?id=10730819"
  65. Sound5.Volume = 1
  66. BoolValue6.Name = "MouseClick"
  67. BoolValue6.Parent = Tool0
  68. Animation7.Name = "TwoHandAnim"
  69. Animation7.Parent = Tool0
  70. Animation7.AnimationId = "http://www.roblox.com/Asset?ID=48138189"
  71. Animation8.Name = "Whack"
  72. Animation8.Parent = Tool0
  73. Animation8.AnimationId = "http://www.roblox.com/Asset?ID=32659706"
  74. LocalScript9.Name = "_CamShake"
  75. LocalScript9.Parent = Tool0
  76. LocalScript9.Disabled = true
  77. table.insert(cors,sandbox(LocalScript9,function()
  78. local cam = game.Workspace.CurrentCamera
  79. for i = 1, 5 do
  80. wait()
  81. local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p --* CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/10, math.random(-10, 10)/10, 0)
  82. local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
  83. local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/40, math.random(-10, 10)/40, 0)
  84. cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
  85. end
  86. script:remove()
  87.  
  88. end))
  89. LocalScript10.Name = "_EVT"
  90. LocalScript10.Parent = Tool0
  91. table.insert(cors,sandbox(LocalScript10,function()
  92. script.Parent.Equipped:connect(function(mouse)
  93. mouse.Button1Down:connect(function()
  94. script.Parent.MouseClick.Value = not script.Parent.MouseClick.Value
  95. end)
  96. end)
  97. end))
  98. Script11.Name = "_SoundDetection"
  99. Script11.Parent = Tool0
  100. table.insert(cors,sandbox(Script11,function()
  101. hammer = script.Parent.Handle
  102. local HomerunSound = Instance.new("Sound")
  103. HomerunSound.SoundId = "http://www.roblox.com/asset/?id=21343225"
  104. HomerunSound.Parent = hammer
  105. HomerunSound.Volume = 0.5
  106. HomerunSound.Name = "Homerun"
  107. local WhackSound = Instance.new("Sound")
  108. WhackSound.SoundId = "http://www.roblox.com/asset/?id=10730819"
  109. WhackSound.Parent = hammer
  110. WhackSound.Volume = 1
  111. WhackSound.Name = "Whack"
  112. hammer.ChildAdded:connect(function(Child)
  113. wait()
  114. if Child.className == "StringValue" then
  115. if Child.Name == "HomerunSound" then
  116. HomerunSound:Play()
  117. elseif Child.Name == "WhackSound" then
  118. WhackSound:Play()
  119. end
  120. Child:Remove()
  121. end
  122. end)
  123. end))
  124. LocalScript12.Name = "_Main"
  125. LocalScript12.Parent = Tool0
  126. table.insert(cors,sandbox(LocalScript12,function()
  127. --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
  128. --player
  129. player = nil
  130. --selected
  131. selected = false
  132. homerunning = false
  133. whacking = false
  134. --save shoulders
  135. RSH, LSH = nil, nil
  136. anim = "none"
  137. --grip
  138. --welds
  139. --what anim
  140. local TwoHandAnim
  141. local HomeRunner
  142. local Whacker
  143. --create the dustcloud object
  144. --set variables
  145. hammer = script.Parent.Handle
  146. --[[local msh = Instance.new("SpecialMesh")
  147. msh.MeshId = "http://www.roblox.com/asset/?id=1095708"
  148. msh.MeshType = 5
  149. msh.Parent = prt]]
  150.  
  151. ----- show version ----------
  152. script.Parent.Name = "BanHammer V1.1"
  153. ---------------------------------
  154.  
  155. function GetFigures(Parent, Part)
  156. for i, v in pairs(Parent:GetChildren()) do
  157. GetFigures(v, Part)
  158. if v.className == "Humanoid" then
  159. if v == script.Parent.Parent:findFirstChild("Humanoid") == false then
  160. if v.Parent:findFirstChild("Torso") then
  161. if v.Parent:findFirstChild("Torso"):IsA("BasePart") then
  162. if v.Parent:findFirstChild("Torso").Position.x < Part.Position.x + Part.Size.x / 2
  163. and v.Parent:findFirstChild("Torso").Position.x > Part.Position.x - Part.Size.x / 2
  164. and v.Parent:findFirstChild("Torso").Position.y < Part.Position.y + Part.Size.y / 2
  165. and v.Parent:findFirstChild("Torso").Position.y > Part.Position.y - Part.Size.y / 2
  166. and v.Parent:findFirstChild("Torso").Position.z < Part.Position.z + Part.Size.z / 2
  167. and v.Parent:findFirstChild("Torso").Position.z > Part.Position.z - Part.Size.z / 2 then
  168. v.Sit = true
  169. end
  170. if (Part.Position - v.Parent:findFirstChild("Torso").Position).magnitude < 10 then
  171. v.Sit = true
  172. end
  173. end
  174. end
  175. end
  176. end
  177. end
  178. end
  179. function Raycast(Pos, Dir, Max, Ignore)
  180. return game:GetService("Workspace"):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
  181. end
  182. function WaitForChild(obj, ch_n)
  183. local t = time()
  184. while not obj:FindFirstChild(ch_n) and time() - t < 10 do wait(0.1) end
  185. return obj:FindFirstChild(ch_n)
  186. end
  187.  
  188. --onselected, save shoulders and get player
  189. script.Parent.Equipped:connect(function()
  190. TwoHandAnim = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.TwoHandAnim)
  191. HomeRunner = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.HomeRun)
  192. Whacker = script.Parent.Parent:findFirstChild("Humanoid"):LoadAnimation(script.Parent.Whack)
  193. repeat wait() until TwoHandAnim ~= nil and HomeRunner ~= nil and Whacker ~= nil
  194. if selected then return end
  195. selected = true
  196. TwoHandAnim:Play()
  197. end)
  198.  
  199. --griptcf = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-math.pi/2+0.5, 0, 0)
  200.  
  201. script.Parent.Unequipped:connect(function()
  202. selected = false
  203. if TwoHandAnim ~= nil then
  204. TwoHandAnim:Stop()
  205. end
  206. if HomeRunner ~= nil then
  207. HomeRunner:Stop()
  208. end
  209. if Whacker ~= nil then
  210. Whacker:Stop()
  211. end
  212. end)
  213.  
  214. function HomeRunHit(part)
  215. if part == nil then return end
  216. if part.Parent == nil then return end
  217. local h = (part.Parent or game):FindFirstChild("Humanoid") --or findfirstchild optimization
  218. if h then
  219. if h == script.Parent.Parent:findFirstChild("Humanoid") == false then
  220. --game.SoundService.Bomb:Play()
  221. -- hammer.Homerun:Play()
  222. hrs = Instance.new("StringValue")
  223. hrs.Name = "HomerunSound"
  224. hrs.Parent = hammer
  225. h.Sit = true
  226. h.Parent.Torso.Velocity = (CFrame.new(hammer.Position, h.Parent.Torso.Position).lookVector * 200) + Vector3.new(0, 100, 0)
  227. h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
  228. end
  229. end
  230. end
  231.  
  232. function HomeRun()
  233. if homerunning == false then
  234. homerunning = true
  235. anim = "homerun"
  236. TwoHandAnim:Stop()
  237. HomeRunner:Play()
  238. --start HomeRunhit connection--
  239. local con = hammer.Touched:connect(HomeRunHit)
  240. ----------------------------------------
  241. wait(.6)
  242. HomeRunner:Stop()
  243. if selected == true then
  244. TwoHandAnim:Play()
  245. end
  246. ----end HomeRun connection---
  247. con:disconnect()
  248. -- wait(0.15)
  249. homerunning = false
  250. end
  251. end
  252. function Whack()
  253. if homerunning == false then
  254. anim = "norm"
  255. TwoHandAnim:Stop()
  256. Whacker:Play()
  257. -- hammer.Whack:Play()
  258. --insert camshake and hit nearby people
  259. for _, p in pairs(game.Players:GetChildren()) do
  260. if p.Character == script.Parent.Parent == false then
  261. if p.Character:FindFirstChild("Torso") then
  262. if (p.Character.Torso.Position - (hammer.CFrame*CFrame.new(0, 3, 0)).p).magnitude < 15 then
  263. local s = script.Parent._CamShake:clone()
  264. s.Disabled = false
  265. s.Parent = p.Backpack
  266. if p ~= player then
  267. -- p.Character.Humanoid.Sit = true
  268. -- delay(0.1, function() p.Character.Humanoid.Jump = true end)
  269. p.Character.Torso.RotVelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10))
  270. end
  271. end
  272. end
  273. end
  274. end
  275. --add dust cloud
  276. delay(0.25, function()
  277. if anim == "norm" then
  278. if selected == true then
  279. whacking = true
  280. p=Instance.new("Part")
  281. p.CanCollide = false
  282. p.Transparency = 1
  283. p.Parent = script.Parent.Parent
  284. p.formFactor = "Custom"
  285. p.Size = Vector3.new(0.2, 0.2, 0.2)
  286. p.Anchored = true
  287. 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)
  288. p.CFrame = CFrame.new(p.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
  289. p.CFrame = p.CFrame * CFrame.fromEulerAnglesXYZ(-math.pi/2, 0, -math.pi/2)
  290. Hit, Pos = Raycast(p.Position, p.CFrame.lookVector, 4, script.Parent.Parent)
  291. if Hit ~= nil then
  292. if homerunning == false then
  293. delay(0.35, function()
  294. w = Instance.new("StringValue")
  295. w.Name = "WhackSound"
  296. w.Parent = hammer
  297. end)
  298. local pt = prt:clone()
  299. pt.Parent = script.Parent.Parent
  300. pt.CFrame = CFrame.new(hammer.CFrame.x, Pos.y + 0.75, hammer.CFrame.z) + script.Parent.Parent:findFirstChild("Torso").CFrame.lookVector * 1.75
  301. GetFigures(pt.Parent.Parent, pt)
  302. game.Debris:addItem(pt, 1.3)
  303. end
  304. end
  305. p:Remove()
  306. end
  307. end
  308. end)
  309. wait(0.75)
  310. Whacker:Stop()
  311. whacking = false
  312. ------
  313. if selected == true then
  314. TwoHandAnim:Play()
  315. end
  316. end
  317. end
  318. local a = false
  319. local co = nil
  320. --OMGHAX mouseclick
  321. local last_click = 0
  322. script.Parent.MouseClick.Changed:connect(function()
  323. if homerunning == false and whacking == false then
  324. if time() - last_click < 0.3 then
  325. anim = "homerun"
  326. last_click = time()
  327. HomeRun()
  328. else
  329. anim = "norm"
  330. last_click = time()
  331. Whack()
  332. end
  333. end
  334. end)
  335. end))
  336. Script13.Name = "qPerfectionWeld"
  337. Script13.Parent = Tool0
  338. table.insert(cors,sandbox(Script13,function()
  339. -- Created by Quenty (@Quenty, follow me on twitter).
  340. -- Should work with only ONE copy, seamlessly with weapons, trains, et cetera.
  341. -- Parts should be ANCHORED before use. It will, however, store relatives values and so when tools are reparented, it'll fix them.
  342.  
  343. --[[ INSTRUCTIONS
  344. - Place in the model
  345. - Make sure model is anchored
  346. - That's it. It will weld the model and all children.
  347.  
  348. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  349. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  350. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  351. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  352. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  353. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  354. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  355. THIS SCRIPT SHOULD BE USED ONLY BY ITSELF. THE MODEL SHOULD BE ANCHORED.
  356.  
  357. 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.
  358. ]]
  359.  
  360. --[[ DOCUMENTATION
  361. - 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.
  362. - Will work in PBS servers
  363. - Will work as long as it starts out with the part anchored
  364. - Stores the relative CFrame as a CFrame value
  365. - Takes careful measure to reduce lag by not having a joint set off or affected by the parts offset from origin
  366. - Utilizes a recursive algorith to find all parts in the model
  367. - Will reweld on script reparent if the script is initially parented to a tool.
  368. - Welds as fast as possible
  369. ]]
  370.  
  371. -- qPerfectionWeld.lua
  372. -- Created 10/6/2014
  373. -- Author: Quenty
  374. -- Version 1.0.3
  375.  
  376. -- Updated 10/14/2014 - Updated to 1.0.1
  377. --- Bug fix with existing ROBLOX welds ? Repro by asimo3089
  378.  
  379. -- Updated 10/14/2014 - Updated to 1.0.2
  380. --- Fixed bug fix.
  381.  
  382. -- Updated 10/14/2014 - Updated to 1.0.3
  383. --- Now handles joints semi-acceptably. May be rather hacky with some joints. :/
  384.  
  385. 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).
  386.  
  387.  
  388. local function CallOnChildren(Instance, FunctionToCall)
  389. -- Calls a function on each of the children of a certain object, using recursion.
  390.  
  391. FunctionToCall(Instance)
  392.  
  393. for _, Child in next, Instance:GetChildren() do
  394. CallOnChildren(Child, FunctionToCall)
  395. end
  396. end
  397.  
  398. local function GetNearestParent(Instance, ClassName)
  399. -- Returns the nearest parent of a certain class, or returns nil
  400.  
  401. local Ancestor = Instance
  402. repeat
  403. Ancestor = Ancestor.Parent
  404. if Ancestor == nil then
  405. return nil
  406. end
  407. until Ancestor:IsA(ClassName)
  408.  
  409. return Ancestor
  410. end
  411.  
  412. local function GetBricks(StartInstance)
  413. local List = {}
  414.  
  415. -- if StartInstance:IsA("BasePart") then
  416. -- List[#List+1] = StartInstance
  417. -- end
  418.  
  419. CallOnChildren(StartInstance, function(Item)
  420. if Item:IsA("BasePart") then
  421. List[#List+1] = Item;
  422. end
  423. end)
  424.  
  425. return List
  426. end
  427.  
  428. local function Modify(Instance, Values)
  429. -- Modifies an Instance by using a table.
  430.  
  431. assert(type(Values) == "table", "Values is not a table");
  432.  
  433. for Index, Value in next, Values do
  434. if type(Index) == "number" then
  435. Value.Parent = Instance
  436. else
  437. Instance[Index] = Value
  438. end
  439. end
  440. return Instance
  441. end
  442.  
  443. local function Make(ClassType, Properties)
  444. -- Using a syntax hack to create a nice way to Make new items.
  445.  
  446. return Modify(Instance.new(ClassType), Properties)
  447. end
  448.  
  449. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  450. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  451.  
  452. local function HasWheelJoint(Part)
  453. for _, SurfaceName in pairs(Surfaces) do
  454. for _, HingSurfaceName in pairs(HingSurfaces) do
  455. if Part[SurfaceName].Name == HingSurfaceName then
  456. return true
  457. end
  458. end
  459. end
  460.  
  461. return false
  462. end
  463.  
  464. local function ShouldBreakJoints(Part)
  465. --- We do not want to break joints of wheels/hinges. This takes the utmost care to not do this. There are
  466. -- definitely some edge cases.
  467.  
  468. if NEVER_BREAK_JOINTS then
  469. return false
  470. end
  471.  
  472. if HasWheelJoint(Part) then
  473. return false
  474. end
  475.  
  476. local Connected = Part:GetConnectedParts()
  477.  
  478. if #Connected == 1 then
  479. return false
  480. end
  481.  
  482. for _, Item in pairs(Connected) do
  483. if HasWheelJoint(Item) then
  484. return false
  485. elseif not Item:IsDescendantOf(script.Parent) then
  486. return false
  487. end
  488. end
  489.  
  490. return true
  491. end
  492.  
  493. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  494. --- Weld's 2 parts together
  495. -- @param Part0 The first part
  496. -- @param Part1 The second part (Dependent part most of the time).
  497. -- @param [JointType] The type of joint. Defaults to weld.
  498. -- @param [WeldParent] Parent of the weld, Defaults to Part0 (so GC is better).
  499. -- @return The weld created.
  500.  
  501. JointType = JointType or "Weld"
  502. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  503.  
  504. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  505. Modify(NewWeld, {
  506. Name = "qCFrameWeldThingy";
  507. Part0 = Part0;
  508. Part1 = Part1;
  509. C0 = CFrame.new();--Part0.CFrame:inverse();
  510. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  511. Parent = Part1;
  512. })
  513.  
  514. if not RelativeValue then
  515. RelativeValue = Make("CFrameValue", {
  516. Parent = Part1;
  517. Name = "qRelativeCFrameWeldValue";
  518. Archivable = true;
  519. Value = NewWeld.C1;
  520. })
  521. end
  522.  
  523. return NewWeld
  524. end
  525.  
  526. local function WeldParts(Parts, MainPart, JointType, DoNotUnanchor)
  527. -- @param Parts The Parts to weld. Should be anchored to prevent really horrible results.
  528. -- @param MainPart The part to weld the model to (can be in the model).
  529. -- @param [JointType] The type of joint. Defaults to weld.
  530. -- @parm DoNotUnanchor Boolean, if true, will not unachor the model after cmopletion.
  531.  
  532. for _, Part in pairs(Parts) do
  533. if ShouldBreakJoints(Part) then
  534. Part:BreakJoints()
  535. end
  536. end
  537.  
  538. for _, Part in pairs(Parts) do
  539. if Part ~= MainPart then
  540. WeldTogether(MainPart, Part, JointType, MainPart)
  541. end
  542. end
  543.  
  544. if not DoNotUnanchor then
  545. for _, Part in pairs(Parts) do
  546. Part.Anchored = false
  547. end
  548. MainPart.Anchored = false
  549. end
  550. end
  551.  
  552. local function PerfectionWeld()
  553. local Tool = GetNearestParent(script, "Tool")
  554.  
  555. local Parts = GetBricks(script.Parent)
  556. 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]
  557.  
  558. if PrimaryPart then
  559. WeldParts(Parts, PrimaryPart, "Weld", false)
  560. else
  561. warn("qWeld - Unable to weld part")
  562. end
  563.  
  564. return Tool
  565. end
  566.  
  567. local Tool = PerfectionWeld()
  568.  
  569.  
  570. if Tool and script.ClassName == "Script" then
  571. --- Don't bother with local scripts
  572.  
  573. script.Parent.AncestryChanged:connect(function()
  574. PerfectionWeld()
  575. end)
  576. end
  577.  
  578. -- Created by Quenty (@Quenty, follow me on twitter).
  579.  
  580. end))
  581. Animation14.Name = "HomeRun"
  582. Animation14.Parent = Tool0
  583. Animation14.AnimationId = "rbxassetid://54673790"
  584. Part15.Name = "ban part"
  585. Part15.Parent = Tool0
  586. Part15.BrickColor = BrickColor.new("Dark stone grey")
  587. Part15.Transparency = 1
  588. Part15.Rotation = Vector3.new(87.8199997, -47.3499985, 90.0099945)
  589. Part15.CanCollide = false
  590. Part15.FormFactor = Enum.FormFactor.Plate
  591. Part15.Size = Vector3.new(0.329999834, 0.340000093, 2.76999855)
  592. Part15.CFrame = CFrame.new(-42.8555717, 3.88386011, -8.58184624, -9.28728914e-05, -0.677499533, -0.735523343, 0.0380967073, 0.734986424, -0.677010179, 0.999273837, -0.0280841347, 0.0257421304)
  593. Part15.BottomSurface = Enum.SurfaceType.Smooth
  594. Part15.TopSurface = Enum.SurfaceType.Smooth
  595. Part15.Color = Color3.new(0.388235, 0.372549, 0.384314)
  596. Part15.Position = Vector3.new(-42.8555717, 3.88386011, -8.58184624)
  597. Part15.Orientation = Vector3.new(42.6100006, -88, 2.97000003)
  598. Part15.Color = Color3.new(0.388235, 0.372549, 0.384314)
  599. Script16.Parent = Part15
  600. table.insert(cors,sandbox(Script16,function()
  601. function onTouched(hit)
  602. game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All,false)
  603. end
  604. script.Parent.Touched:connect(onTouched)
  605. end))
  606. Part17.Name = "ban part"
  607. Part17.Parent = Tool0
  608. Part17.BrickColor = BrickColor.new("Dark stone grey")
  609. Part17.Transparency = 1
  610. Part17.Rotation = Vector3.new(87.8199997, -47.3499985, 90.0099945)
  611. Part17.CanCollide = false
  612. Part17.FormFactor = Enum.FormFactor.Plate
  613. Part17.Size = Vector3.new(0.329999834, 0.340000093, 2.76999855)
  614. Part17.CFrame = CFrame.new(-42.8555717, 3.88386011, -8.58184624, -9.28728914e-05, -0.677499533, -0.735523343, 0.0380967073, 0.734986424, -0.677010179, 0.999273837, -0.0280841347, 0.0257421304)
  615. Part17.BottomSurface = Enum.SurfaceType.Smooth
  616. Part17.TopSurface = Enum.SurfaceType.Smooth
  617. Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
  618. Part17.Position = Vector3.new(-42.8555717, 3.88386011, -8.58184624)
  619. Part17.Orientation = Vector3.new(42.6100006, -88, 2.97000003)
  620. Part17.Color = Color3.new(0.388235, 0.372549, 0.384314)
  621. Script18.Parent = Part17
  622. table.insert(cors,sandbox(Script18,function()
  623. function ontouched(part)--when part is touched
  624. part.Parent:Remove()--object that touched the script's parent, remove
  625. end--end function
  626. script.Parent.Touched:connect(ontouched)--ontouched means when the script's parent is touched
  627. -- in short: when the script's parent is touched, remove the object that touched the script's parent's parent
  628. end))
  629. for i,v in pairs(mas:GetChildren()) do
  630. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  631. pcall(function() v:MakeJoints() end)
  632. end
  633. mas:Destroy()
  634. for i,v in pairs(cors) do
  635. spawn(function()
  636. pcall(v)
  637. end)
  638. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement