Advertisement
-----------------

tool pack reupload

May 11th, 2021
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.21 KB | None | 0 0
  1. if owner.Backpack:FindFirstChild("Phone") then
  2. owner.Backpack:FindFirstChild("Phone"):Destroy()
  3. end
  4. if owner.Backpack:FindFirstChild("Ender Pearl") then
  5. owner.Backpack:FindFirstChild("Ender Pearl"):Destroy()
  6. end
  7.  
  8. spawn(function()
  9. local Tool0 = Instance.new("Tool")
  10. local Part1 = Instance.new("Part")
  11. local ParticleEmitter2 = Instance.new("ParticleEmitter")
  12. local BillboardGui3 = Instance.new("BillboardGui")
  13. local ImageLabel4 = Instance.new("ImageLabel")
  14. local LocalScript5 = Instance.new("LocalScript")
  15. Tool0.Name = "Ender Pearl"
  16. Tool0.Parent = owner.Backpack
  17. Tool0.Grip = CFrame.new(0.200000003, 0, 0.100000001, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  18. Tool0.GripPos = Vector3.new(0.200000003, 0, 0.100000001)
  19. Part1.Name = "Handle"
  20. Part1.Parent = Tool0
  21. Part1.CFrame = CFrame.new(46.7503319, 4.53458595, 45.4952736, -0.136415645, -0.0254911631, -0.990323722, -0.0140755745, 0.999617755, -0.0237914771, 0.99055177, 0.0106938463, -0.136722296)
  22. Part1.Orientation = Vector3.new(1.36000001, -97.8600006, -0.810000002)
  23. Part1.Position = Vector3.new(46.7503319, 4.53458595, 45.4952736)
  24. Part1.Rotation = Vector3.new(170.130005, -82.0199966, 169.419998)
  25. Part1.Color = Color3.new(0.0627451, 0.164706, 0.862745)
  26. Part1.Transparency = 1
  27. Part1.Size = Vector3.new(0.699999988, 0.699999988, 0.699999988)
  28. Part1.BottomSurface = Enum.SurfaceType.Smooth
  29. Part1.BrickColor = BrickColor.new("Lapis")
  30. Part1.CanCollide = false
  31. Part1.Material = Enum.Material.Neon
  32. Part1.TopSurface = Enum.SurfaceType.Smooth
  33. Part1.brickColor = BrickColor.new("Lapis")
  34. Part1.Shape = Enum.PartType.Ball
  35. ParticleEmitter2.Parent = Part1
  36. ParticleEmitter2.Speed = NumberRange.new(0.60000002384186, 0.60000002384186)
  37. ParticleEmitter2.Color = ColorSequence.new(Color3.new(0.333333, 0, 0.498039),Color3.new(0.666667, 0, 1))
  38. ParticleEmitter2.LightInfluence = 1
  39. ParticleEmitter2.Transparency = NumberSequence.new(0,0,1)
  40. ParticleEmitter2.Size = NumberSequence.new(0.10000000149012,0.10000000149012)
  41. ParticleEmitter2.Lifetime = NumberRange.new(0.5, 0.5)
  42. ParticleEmitter2.Rate = 10
  43. BillboardGui3.Name = "image"
  44. BillboardGui3.Parent = Part1
  45. BillboardGui3.Size = UDim2.new(1, 0, 1, 0)
  46. ImageLabel4.Parent = BillboardGui3
  47. ImageLabel4.Size = UDim2.new(1, 0, 1, 0)
  48. ImageLabel4.BackgroundColor = BrickColor.new("Institutional white")
  49. ImageLabel4.BackgroundColor3 = Color3.new(1, 1, 1)
  50. ImageLabel4.BackgroundTransparency = 1
  51. ImageLabel4.SizeConstraint = Enum.SizeConstraint.RelativeXX
  52. ImageLabel4.Image = "rbxassetid://140576058"
  53. LocalScript5.Parent = Tool0
  54. ----------------------------------------------
  55. ----------------------------------------------
  56. ----------------------------------------------
  57.  
  58. local player = owner
  59.  
  60. repeat wait() until player.Character
  61.  
  62. local character = player.Character
  63.  
  64. local handle = Part1
  65. local tool = Tool0
  66. local mouse = player:GetMouse()
  67.  
  68. local power = 300
  69. local equipped = false
  70.  
  71. tool.Equipped:connect(function()
  72. equipped = true
  73. end)
  74. tool.Unequipped:connect(function()
  75. equipped = false
  76. end)
  77.  
  78. local remote = Instance.new("RemoteEvent",Tool0)
  79. remote.Name = "remote pearl"
  80.  
  81. local code = [[
  82. remote = script.Parent:WaitForChild("remote pearl")
  83. mouse = game.Players.LocalPlayer:GetMouse()
  84. mouse.Button1Down:Connect(function()
  85. local pos = mouse.Hit.p
  86. remote:FireServer(pos,1)
  87. end)
  88. mouse.KeyDown:Connect(function(key)
  89. local pos = mouse.Hit.p
  90. remote:FireServer(key,2,pos)
  91. end)
  92. ]]
  93.  
  94. NLS(code,Tool0)
  95.  
  96. local oldmousepos = nil
  97. local mousepos = nil
  98.  
  99. remote.OnServerEvent:Connect(function(plr,pos,mode)
  100. if mode == 1 then
  101. oldmousepos = mousepos
  102. mousepos = pos
  103. end
  104. end)
  105.  
  106. remote.OnServerEvent:Connect(function(plr,key,mode,pos)
  107. spawn(function()
  108. if mode == 2 and key == "e" and equipped == true then
  109. oldmousepos = mousepos
  110. mousepos = pos
  111. local pag = Instance.new("Part")
  112. pag.Parent = game.Workspace
  113. pag.CanCollide = false
  114. pag.Transparency = 1
  115. pag.Anchored = true
  116. pag.CanCollide = false
  117. repeat wait() until oldmousepos ~= mousepos
  118. pag.CFrame = CFrame.new(handle.Position,mousepos)
  119.  
  120. local pearl = handle:Clone()
  121. pearl.Parent = game.Workspace
  122. pearl.Name = "EnderPearl"
  123. pearl.CanCollide = false
  124. pearl.Velocity = pag.CFrame.lookVector * power
  125.  
  126. pearl.Touched:connect(function(part)
  127. if part ~= nil then
  128. if part.Parent ~= nil then
  129. if part.Parent ~= character and part.Name ~= "Handle" and part.Name ~= "EnderPearl" and part.Name ~= "Ender Sphere" then
  130. local ex = Instance.new("Explosion",workspace)
  131. ex.BlastPressure = 1
  132. ex.BlastRadius = 12
  133. ex.ExplosionType = Enum.ExplosionType.CratersAndDebris
  134. ex.Visible = false
  135. ex.Hit:Connect(function(obj)
  136. obj:BreakJoints()
  137. end)
  138. local sphere = Instance.new("Part",workspace)
  139. sphere.Name = "Ender Sphere"
  140. sphere.Shape = Enum.PartType.Ball
  141. sphere.BrickColor = BrickColor.new("Really black")
  142. sphere.Size = Vector3.new(2,2,2)
  143. sphere.Material = Enum.Material.Neon
  144. sphere.Anchored = true
  145. sphere.CanCollide = false
  146. sphere.Position = pearl.Position
  147. ex.Position = pearl.Position
  148. spawn(function()
  149. for i = 0,9,1 do
  150. wait()
  151. sphere.Size = sphere.Size+Vector3.new(3,3,3)
  152. sphere.Transparency = sphere.Transparency+.1
  153. end
  154. sphere:Destroy()
  155. end)
  156. local boom = Instance.new("Sound",Part1)
  157. boom.Volume = 2
  158. boom.EmitterSize = 3
  159. boom.MinDistance = 3
  160. boom.SoundId = "rbxassetid://3154829820"
  161. boom.Looped = false
  162. boom:Play()
  163. pearl:Destroy()
  164. end
  165. end
  166. end
  167. end)
  168. pag:Destroy()
  169. end
  170. end)
  171. spawn(function()
  172. if mode == 2 and key == "f" and equipped == true then
  173. oldmousepos = mousepos
  174. mousepos = pos
  175. local pag = Instance.new("Part")
  176. pag.Parent = game.Workspace
  177. pag.CanCollide = false
  178. pag.Transparency = 1
  179. pag.Anchored = true
  180. pag.CanCollide = false
  181. repeat wait() until oldmousepos ~= mousepos
  182. pag.CFrame = CFrame.new(handle.Position,mousepos)
  183.  
  184. local pearl = handle:Clone()
  185. pearl.Parent = game.Workspace
  186. pearl.Name = "EnderPearl"
  187. pearl.CanCollide = false
  188. pearl.Velocity = pag.CFrame.lookVector * power
  189.  
  190. pearl.Touched:connect(function(part)
  191. if part ~= nil then
  192. if part.Parent ~= nil then
  193. if part.Parent ~= character and part.Name ~= "Handle" and part.Name ~= "EnderPearl" and part.Name ~= "Ender Sphere" then
  194. local sphere = Instance.new("Part",workspace)
  195. sphere.Name = "Ender Sphere"
  196. sphere.Shape = Enum.PartType.Ball
  197. sphere.BrickColor = BrickColor.new("Bright green")
  198. sphere.Size = Vector3.new(3,3,3)
  199. sphere.Material = Enum.Material.ForceField
  200. sphere.Anchored = true
  201. sphere.CanCollide = false
  202. sphere.Position = pearl.Position
  203. sphere.Transparency = 1
  204. spawn(function()
  205. for i = 0,9,1 do
  206. wait()
  207. sphere.Size = sphere.Size+Vector3.new(3,3,3)
  208. sphere.Transparency = sphere.Transparency-.1
  209. end
  210. end)
  211. local ff = Instance.new("Sound",Part1)
  212. ff.Volume = 3
  213. ff.EmitterSize = 6
  214. ff.MinDistance = 6
  215. ff.SoundId = "rbxassetid://306606354"
  216. ff.Looped = true
  217. ff:Play()
  218. sphere.Touched:Connect(function(obj)
  219. if obj.Name == "Base" or obj.Name == "Baseplate" then return end
  220. local hum = obj.Parent:FindFirstChildOfClass("Humanoid")
  221. if hum ~= nil and not hum:FindFirstChild("health wait") then
  222. spawn(function()
  223. local val = Instance.new("NumberValue",hum)
  224. val.Name = "health wait"
  225. hum.Health = hum.Health + 30
  226. wait(.5)
  227. val:Destroy()
  228. end)
  229. end
  230. end)
  231. spawn(function()
  232. wait(math.random(5,10))
  233. for i = 0,9,1 do
  234. wait()
  235. ff.Volume = ff.Volume-.3
  236. sphere.Size = sphere.Size-Vector3.new(2,2,2)
  237. sphere.Transparency = sphere.Transparency+.1
  238. end
  239. ff:Destroy()
  240. sphere:Destroy()
  241. end)
  242. local boom = Instance.new("Sound",Part1)
  243. boom.Volume = 2
  244. boom.EmitterSize = 2
  245. boom.MinDistance = 2
  246. boom.SoundId = "rbxassetid://3154829820"
  247. boom.Looped = false
  248. boom:Play()
  249. pearl:Destroy()
  250. end
  251. end
  252. end
  253. end)
  254. pag:Destroy()
  255. end
  256. end)
  257. end)
  258.  
  259. tool.Activated:connect(function()
  260. if equipped == true then
  261. local pag = Instance.new("Part")
  262. pag.Parent = game.Workspace
  263. pag.CanCollide = false
  264. pag.Transparency = 1
  265. pag.Anchored = true
  266. pag.CanCollide = false
  267. repeat wait() until oldmousepos ~= mousepos
  268. pag.CFrame = CFrame.new(handle.Position,mousepos)
  269.  
  270. local pearl = handle:Clone()
  271. pearl.Parent = game.Workspace
  272. pearl.Name = "EnderPearl"
  273. pearl.CanCollide = false
  274. pearl.Velocity = pag.CFrame.lookVector * power
  275.  
  276. pearl.Touched:connect(function(part)
  277. if part ~= nil then
  278. if part.Parent ~= nil then
  279. if part.Parent ~= character and part.Name ~= "Handle" and part.Name ~= "EnderPearl" and part.Name ~= "Ender Sphere" then
  280. character.PrimaryPart.Parent:FindFirstChildOfClass("Humanoid"):TakeDamage(5,7.5)
  281. local hurt = Instance.new("Sound",character.PrimaryPart)
  282. hurt.Volume = 1.5
  283. hurt.EmitterSize = 2
  284. hurt.MinDistance = 2
  285. hurt.SoundId = "rbxassetid://535690488"
  286. hurt.Looped = false
  287. hurt:Play()
  288. local sphere = Instance.new("Part",workspace)
  289. sphere.Name = "Ender Sphere"
  290. sphere.Shape = Enum.PartType.Ball
  291. sphere.BrickColor = BrickColor.new("Dark indigo")
  292. sphere.Size = Vector3.new(2,2,2)
  293. sphere.Material = Enum.Material.ForceField
  294. sphere.Anchored = true
  295. sphere.CanCollide = false
  296. sphere.Position = pearl.Position
  297. spawn(function()
  298. for i = 0,9,1 do
  299. wait()
  300. sphere.Size = sphere.Size+Vector3.new(3,3,3)
  301. sphere.Transparency = sphere.Transparency+.1
  302. end
  303. sphere:Destroy()
  304. end)
  305. local warp = Instance.new("Sound",handle)
  306. warp.SoundId = "rbxassetid://289556450"
  307. warp.Volume = 4
  308. warp.EmitterSize = 4
  309. warp:Play()
  310. local rotation = character.PrimaryPart.CFrame - character.PrimaryPart.Position
  311. character.PrimaryPart.CFrame = rotation + pearl.Position + Vector3.new(0,4,0)
  312. pearl:Destroy()
  313. end
  314. end
  315. end
  316. end)
  317. pag:Destroy()
  318. end
  319. end)
  320. end)
  321.  
  322. spawn(function()
  323. local Tool0 = Instance.new("Tool")
  324. local Part1 = Instance.new("Part")
  325. local Part2 = Instance.new("Part")
  326. local Sound3 = Instance.new("Sound")
  327. local Sound4 = Instance.new("Sound")
  328. local Sound5 = Instance.new("Sound")
  329. local Sound6 = Instance.new("Sound")
  330. local Part6 = Instance.new("Part")
  331. local Part7 = Instance.new("Part")
  332. local SpotLight0 = Instance.new("SpotLight")
  333. Tool0.Name = "Phone"
  334. Tool0.Parent = owner.Backpack
  335. Tool0.CanBeDropped = true
  336. Part1.Name = "Handle"
  337. Part1.Parent = Tool0
  338. Part1.CFrame = CFrame.new(1.70019865, 1.50620151, 14.9028263, 0, 1, 0, 0, 0, 1, 1, 0, 0)
  339. Part1.Orientation = Vector3.new(-90, -90, 0)
  340. Part1.Position = Vector3.new(1.70019865, 1.50620151, 14.9028263)
  341. Part1.Rotation = Vector3.new(-90, 0, -90)
  342. Part1.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  343. Part1.Transparency = 1
  344. Part1.Size = Vector3.new(0.0500000007, 0.0500000007, 0.100000001)
  345. Part1.BottomSurface = Enum.SurfaceType.Smooth
  346. Part1.BrickColor = BrickColor.new("Really black")
  347. Part1.CanCollide = false
  348. Part1.Material = Enum.Material.SmoothPlastic
  349. Part1.TopSurface = Enum.SurfaceType.Smooth
  350. Part1.brickColor = BrickColor.new("Really black")
  351. Part2.Name = "Main"
  352. Part2.Parent = Tool0
  353. Part2.CFrame = CFrame.new(2.58999991, 1.76573157, 14.7767668, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  354. Part2.Position = Vector3.new(2.58999991, 1.76573157, 14.7767668)
  355. Part2.Color = Color3.new(0.0666667, 0.0666667, 0.0666667)
  356. Part2.Size = Vector3.new(1.36016214, 0.0919028297, 0.698461592)
  357. Part2.BottomSurface = Enum.SurfaceType.Smooth
  358. Part2.BrickColor = BrickColor.new("Really black")
  359. Part2.CanCollide = false
  360. Part2.Material = Enum.Material.SmoothPlastic
  361. Part2.TopSurface = Enum.SurfaceType.Smooth
  362. Part2.brickColor = BrickColor.new("Really black")
  363. Sound3.Name = "call"
  364. Sound3.Parent = Part2
  365. Sound3.EmitterSize = 1
  366. Sound3.MinDistance = 1
  367. Sound3.SoundId = "rbxassetid://1500107704"
  368. Sound3.Volume = 1
  369. Sound4.Name = "ring"
  370. Sound4.Parent = Part2
  371. Sound4.EmitterSize = 1
  372. Sound4.MinDistance = 2
  373. Sound4.SoundId = "rbxassetid://152841131"
  374. Sound4.Volume = 1
  375. Sound5.Name = "click"
  376. Sound5.Parent = Part2
  377. Sound5.EmitterSize = 1
  378. Sound5.MinDistance = 1
  379. Sound5.SoundId = "rbxassetid://537744814"
  380. Sound5.Volume = 1
  381. Sound6.Name = "selfdestruct"
  382. Sound6.Parent = Part2
  383. Sound6.EmitterSize = 2
  384. Sound6.MinDistance = 2
  385. Sound6.SoundId = "rbxassetid://863434024"
  386. Sound6.Volume = 2
  387. Part6.Parent = Tool0
  388. Part6.CFrame = CFrame.new(2.64514279, 1.7773366, 14.7765141, 1, 0, 0, 0, 1, 0, 0, 0, 1)
  389. Part6.Position = Vector3.new(2.64514279, 1.7773366, 14.7765141)
  390. Part6.Color = Color3.new(0.0705882, 0.933333, 0.831373)
  391. Part6.Size = Vector3.new(1.15062356, 0.079649128, 0.612685621)
  392. Part6.BottomSurface = Enum.SurfaceType.Smooth
  393. Part6.BrickColor = BrickColor.new("Teal")
  394. Part6.CanCollide = false
  395. Part6.Material = Enum.Material.Neon
  396. Part6.TopSurface = Enum.SurfaceType.Smooth
  397. Part6.brickColor = BrickColor.new("Teal")
  398. Part7.Parent = Tool0
  399. Part7.CFrame = CFrame.new(1.98568106, 1.79264569, 14.7817907, 0, -1, 0, 1, 0, 0, 0, 0, 1)
  400. Part7.Orientation = Vector3.new(0, 0, 90)
  401. Part7.Position = Vector3.new(1.98568106, 1.79264569, 14.7817907)
  402. Part7.Rotation = Vector3.new(0, 0, 90)
  403. Part7.Color = Color3.new(0.972549, 0.972549, 0.972549)
  404. Part7.Size = Vector3.new(0.0500000007, 0.100000001, 0.100000001)
  405. Part7.BottomSurface = Enum.SurfaceType.Smooth
  406. Part7.BrickColor = BrickColor.new("Institutional white")
  407. Part7.CanCollide = false
  408. Part7.Material = Enum.Material.SmoothPlastic
  409. Part7.TopSurface = Enum.SurfaceType.Smooth
  410. Part7.brickColor = BrickColor.new("Institutional white")
  411. Part7.Shape = Enum.PartType.Cylinder
  412. SpotLight0.Parent = Part1
  413. SpotLight0.Face = Enum.NormalId.Front
  414. SpotLight0.Range = 12
  415. SpotLight0.Brightness = 8
  416. SpotLight0.Shadows = true
  417. SpotLight0.Enabled = false
  418.  
  419. function tap()
  420. Sound5:Play()
  421. SpotLight0.Enabled = not SpotLight0.Enabled
  422. end
  423.  
  424. local destruct = false
  425. local calling = false
  426.  
  427. local remote = Instance.new("RemoteEvent",Tool0)
  428.  
  429. local code = [[
  430. wait(.2)
  431. mouse = game:GetService("Players").LocalPlayer:GetMouse()
  432. remote = script.Parent
  433.  
  434. mouse.KeyDown:Connect(function(k)
  435. remote:FireServer(k)
  436. end)
  437. ]]
  438.  
  439. local lastchar = owner.Character
  440. local equipped = false
  441.  
  442. NLS(code,remote)
  443.  
  444. Tool0.Unequipped:Connect(function()
  445. equipped = false
  446. end)
  447.  
  448. remote.OnServerEvent:Connect(function(plr,key)
  449. Tool0.Equipped:Connect(function()
  450. equipped = true
  451. if key == "e" and destruct == false and equipped == true then
  452. destruct = true
  453. Sound3:Stop()
  454. local warning = Instance.new("Sound",Part2)
  455. warning.Volume = 2
  456. warning.EmitterSize = 3
  457. warning.MinDistance = 2
  458. warning.SoundId = "rbxassetid://867511220"
  459. warning.Looped = false
  460. warning.TimePosition = .5
  461. warning:Play()
  462. repeat wait() until warning.TimePosition > 3
  463. Sound6:Play()
  464. Sound6.TimePosition = 110
  465. calling = false
  466. Part6.BrickColor = BrickColor.new("Really red")
  467. spawn(function()
  468. while true do
  469. wait()
  470. if Tool0 and game:GetService("Players"):GetPlayerFromCharacter(Tool0.Parent) then
  471. lastchar = Tool0.Parent
  472. else
  473. Tool0.Parent = lastchar
  474. end
  475. if lastchar:FindFirstChildOfClass("ForceField") then
  476. lastchar:FindFirstChildOfClass("ForceField"):Destroy()
  477. end
  478. end
  479. end)
  480. spawn(function()
  481. repeat wait() until Sound6.TimePosition > 124
  482. local ex = Instance.new("Explosion",workspace)
  483. ex.BlastPressure = 1
  484. ex.BlastRadius = 20
  485. ex.ExplosionType = Enum.ExplosionType.CratersAndDebris
  486. --ex.Position = Part1.Position
  487. ex.Visible = false
  488. local sphere = Instance.new("Part",workspace)
  489. sphere.Shape = Enum.PartType.Ball
  490. sphere.BrickColor = BrickColor.new("Really red")
  491. sphere.Size = Vector3.new(2,2,2)
  492. sphere.Material = Enum.Material.Neon
  493. sphere.Anchored = true
  494. sphere.CanCollide = false
  495. sphere.Position = lastchar:FindFirstChild("HumanoidRootPart").Position
  496. ex.Position = lastchar:FindFirstChild("HumanoidRootPart").Position
  497. spawn(function()
  498. for i = 0,9,1 do
  499. wait()
  500. sphere.Size = sphere.Size+Vector3.new(3,3,3)
  501. sphere.Transparency = sphere.Transparency+.1
  502. end
  503. sphere:Destroy()
  504. end)
  505. local boom = Instance.new("Sound",Part1)
  506. boom.Volume = 2
  507. boom.EmitterSize = 2
  508. boom.MinDistance = 2
  509. boom.SoundId = "rbxassetid://3154829820"
  510. boom.Looped = false
  511. boom:Play()
  512. end)
  513. end
  514. if key == "r" and destruct == false and calling == false then
  515. calling = true
  516. Sound3:Play()
  517. spawn(function()
  518. repeat wait() until (Sound3.TimePosition > 20 or calling == false)
  519. calling = false
  520. wait(math.random(10,15))
  521. Sound3:Stop()
  522. if calling == false and destruct == false then
  523. for i = 0,4,1 do
  524. Sound4:Play()
  525. wait(2.6379)
  526. end
  527. end
  528. end)
  529. end
  530. --[[if key == "f" then
  531. for i,v in pairs(game:GetService("Players"):GetChildren()) do
  532. if mouse.Target.Parent.Name == v.Name then
  533. Tool0.Parent = v.Backpack
  534. end
  535. end
  536. end]]
  537. end)
  538. end)
  539.  
  540. Tool0.Activated:Connect(function()
  541. tap()
  542. end)
  543.  
  544. function GetPlr(plr, str)
  545. local plrz = {} str = str:lower()
  546. if str == "all" then plrz = game:GetService("Players"):children()
  547. elseif str == "others" then for i, v in pairs(game:GetService("Players"):children()) do if v ~= plr then table.insert(plrz, v) end end
  548. else
  549. local sn = {1} local en = {}
  550. for i = 1, #str do if str:sub(i,i) == "," then table.insert(sn, i+1) table.insert(en,i-1) end end
  551. for x = 1, #sn do
  552. if (sn[x] and en[x] and str:sub(sn[x],en[x]) == "me") or (sn[x] and str:sub(sn[x]) == "me") then table.insert(plrz, plr)
  553. if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x],en[x]):sub(6)) == 1 then
  554. for q, p in pairs(game:GetService("Players"):children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  555. end end end
  556. elseif (sn[x] and str:sub(sn[x]):sub(1,4):lower() == "team") then
  557. if game:findFirstChild("Teams") then for a, v in pairs(game.Teams:children()) do if v:IsA("Team") and str:sub(sn[x],en[x]):sub(6) ~= "" and v.Name:lower():find(str:sub(sn[x]):sub(6)) == 1 then
  558. for q, p in pairs(game:GetService("Players"):children()) do if p.TeamColor == v.TeamColor then table.insert(plrz, p) end end break
  559. end end end
  560. else
  561. for a, plyr in pairs(game:GetService("Players"):children()) do
  562. if (sn[x] and en[x] and str:sub(sn[x],en[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x],en[x])) == 1) or (sn[x] and str:sub(sn[x]) ~= "" and plyr.Name:lower():find(str:sub(sn[x])) == 1) or (str ~= "" and plyr.Name:lower():find(str) == 1) then
  563. table.insert(plrz, plyr) break
  564. end
  565. end
  566. end
  567. end
  568. end
  569. return plrz
  570. end
  571.  
  572. owner.Chatted:Connect(function(msg)
  573. if msg:sub(1,5) == "give/" then
  574. local plrz = GetPlr(owner, msg:lower():sub(6))
  575. for i, v in pairs(plrz) do
  576. coroutine.resume(coroutine.create(function()
  577. if v and v.Character then
  578. lastchar = v.Character
  579. Tool0.Parent = v.Backpack
  580. end
  581. end))
  582. end
  583. end
  584. end)
  585.  
  586. spawn(function()
  587. local NEVER_BREAK_JOINTS = false
  588.  
  589.  
  590. local function CallOnChildren(Instance, FunctionToCall)
  591. FunctionToCall(Instance)
  592.  
  593. for _, Child in next, Instance:GetChildren() do
  594. CallOnChildren(Child, FunctionToCall)
  595. end
  596. end
  597.  
  598. local function GetNearestParent(Instance, ClassName)
  599. local Ancestor = Instance
  600. repeat
  601. Ancestor = Ancestor.Parent
  602. if Ancestor == nil then
  603. return nil
  604. end
  605. until Ancestor:IsA(ClassName)
  606.  
  607. return Ancestor
  608. end
  609.  
  610. local function GetBricks(StartInstance)
  611. local List = {}
  612. CallOnChildren(StartInstance, function(Item)
  613. if Item:IsA("BasePart") then
  614. List[#List+1] = Item;
  615. end
  616. end)
  617.  
  618. return List
  619. end
  620.  
  621. local function Modify(Instance, Values)
  622. assert(type(Values) == "table", "Values is not a table");
  623.  
  624. for Index, Value in next, Values do
  625. if type(Index) == "number" then
  626. Value.Parent = Instance
  627. else
  628. Instance[Index] = Value
  629. end
  630. end
  631. return Instance
  632. end
  633.  
  634. local function Make(ClassType, Properties)
  635. return Modify(Instance.new(ClassType), Properties)
  636. end
  637.  
  638. local Surfaces = {"TopSurface", "BottomSurface", "LeftSurface", "RightSurface", "FrontSurface", "BackSurface"}
  639. local HingSurfaces = {"Hinge", "Motor", "SteppingMotor"}
  640.  
  641. local function HasWheelJoint(Part)
  642. for _, SurfaceName in pairs(Surfaces) do
  643. for _, HingSurfaceName in pairs(HingSurfaces) do
  644. if Part[SurfaceName].Name == HingSurfaceName then
  645. return true
  646. end
  647. end
  648. end
  649.  
  650. return false
  651. end
  652.  
  653. local function ShouldBreakJoints(Part)
  654. if NEVER_BREAK_JOINTS then
  655. return false
  656. end
  657.  
  658. if HasWheelJoint(Part) then
  659. return false
  660. end
  661.  
  662. local Connected = Part:GetConnectedParts()
  663.  
  664. if #Connected == 1 then
  665. return false
  666. end
  667.  
  668. for _, Item in pairs(Connected) do
  669. if HasWheelJoint(Item) then
  670. return false
  671. elseif not Item:IsDescendantOf(script.Parent) then
  672. return false
  673. end
  674. end
  675.  
  676. return true
  677. end
  678.  
  679. local function WeldTogether(Part0, Part1, JointType, WeldParent)
  680. JointType = JointType or "Weld"
  681. local RelativeValue = Part1:FindFirstChild("qRelativeCFrameWeldValue")
  682.  
  683. local NewWeld = Part1:FindFirstChild("qCFrameWeldThingy") or Instance.new(JointType)
  684. Modify(NewWeld, {
  685. Name = "qCFrameWeldThingy";
  686. Part0 = Part0;
  687. Part1 = Part1;
  688. C0 = CFrame.new();--Part0.CFrame:inverse();
  689. C1 = RelativeValue and RelativeValue.Value or Part1.CFrame:toObjectSpace(Part0.CFrame); --Part1.CFrame:inverse() * Part0.CFrame;-- Part1.CFrame:inverse();
  690. Parent = Part1;
  691. })
  692.  
  693. if not RelativeValue then
  694. RelativeValue = Make("CFrameValue", {
  695. Parent = Part1;
  696. Name = "qRelativeCFrameWeldValue";
  697. Archivable = true;
  698. Value = NewWeld.C1;
  699. })
  700. end
  701.  
  702. return NewWeld
  703. end
  704.  
  705. local function WeldParts(Parts, MainPart, JointType)
  706. for _, Part in pairs(Parts) do
  707. if ShouldBreakJoints(Part) then
  708. Part:BreakJoints()
  709. end
  710. end
  711.  
  712. for _, Part in pairs(Parts) do
  713. if Part ~= MainPart then
  714. WeldTogether(MainPart, Part, JointType, MainPart)
  715. end
  716. end
  717. end
  718.  
  719. local function PerfectionWeld()
  720. local Tool = GetNearestParent(script, "Tool")
  721.  
  722. local Parts = GetBricks(Tool0)
  723. local PrimaryPart = Part1
  724.  
  725. if PrimaryPart then
  726. WeldParts(Parts, PrimaryPart, "Weld")
  727. else
  728. warn("qWeld - Unable to weld part")
  729. end
  730.  
  731. return Tool
  732. end
  733.  
  734. local Tool = PerfectionWeld()
  735.  
  736.  
  737. if Tool and script.ClassName == "Script" then
  738. script.Parent.AncestryChanged:connect(function()
  739. PerfectionWeld()
  740. end)
  741. end
  742. end)
  743. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement