Advertisement
Dark_EccentricYT

sonic screwdriver

Jul 16th, 2016
393
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.13 KB | None | 0 0
  1. if script == nil then return end
  2.  
  3.  
  4. ModelName = "Sonic Screwdriver"
  5. Player = Game:GetService("Players").LocalPlayer
  6. Selected = false
  7. Connected = false
  8. Button1Down = false
  9. CanUse = true
  10. CanEdit = false
  11. PitchMod = 0
  12. TARDISLink = nil
  13.  
  14.  
  15. function CheckPlayer()
  16. if Player.Character == nil then return false end
  17. if Player.Character:FindFirstChild("Torso") == nil or Player.Character:FindFirstChild("Right Arm") == nil or Player.Character:FindFirstChild("Humanoid") == nil then return false end
  18. if Player.Character.Humanoid.Health <= 0 then return false end
  19. return true
  20. end
  21.  
  22.  
  23. function CreateBrickBeam(Position1, Position2)
  24. local Beam = Instance.new("Part", Workspace)
  25. Beam.Name = "SSD Beam"
  26. Beam.FormFactor = "Custom"
  27. Beam.TopSurface = 0
  28. Beam.BottomSurface = 0
  29. Beam.Anchored = true
  30. Beam.CanCollide = false
  31. Beam.Size = Vector3.new(0.2, 0.2, 0.2)
  32. Beam.BrickColor = BrickColor.new("Really blue")
  33. local Mesh = Instance.new("SpecialMesh", Beam)
  34. Mesh.MeshType = "Brick"
  35. pcall(function()
  36. Beam.Mesh.Scale = Vector3.new(0.5, 0.5, (Position1 - Position2).magnitude / 0.2)
  37. Beam.CFrame = CFrame.new((Position1 + Position2) / 2, Position2)
  38. end)
  39. return Beam
  40. end
  41.  
  42. SoundToServer = function(Name, SoundId, Pitch, Volume, Looped, Parent)
  43. local Sound = Instance.new("Sound")
  44. Sound.Name = Name
  45. Sound.SoundId = SoundId
  46. Sound.Pitch = Pitch
  47. Sound.Volume = Volume
  48. Sound.Looped = Looped
  49. Sound.Parent = Parent
  50. Sound:Play()
  51. end
  52.  
  53.  
  54. function CreateParts(Parent, Format)
  55. if Parent == nil then return end
  56. local Parts = Instance.new("Model")
  57. Parts.Name = ModelName
  58. if Format == 1 then
  59. Parts.Name = Parts.Name.. " (Holstered)"
  60. end
  61. Parts.Parent = Parent
  62.  
  63. local MasterPart1 = Instance.new("Part")
  64. MasterPart1.Name = "Handle"
  65. MasterPart1.BrickColor = BrickColor.new("Phosph. White")
  66. MasterPart1.TopSurface = 0
  67. MasterPart1.BottomSurface = 0
  68. MasterPart1.FormFactor = "Custom"
  69. MasterPart1.Size = Vector3.new(0.2, 0.5, 0.2)
  70. MasterPart1.Locked = true
  71. MasterPart1.CanCollide = false
  72. MasterPart1.Parent = Parts
  73. local Mesh = Instance.new("CylinderMesh", MasterPart1)
  74. local Weld = Instance.new("Weld", MasterPart1)
  75. Weld.Part0 = Weld.Parent
  76. if Format == 1 then
  77. Weld.Part1 = Player.Character:FindFirstChild("Torso")
  78. Weld.C1 = CFrame.new(-0.75, 0, -0.6)
  79. elseif Format == 2 then
  80. Weld.Part1 = Player.Character:FindFirstChild("Right Arm")
  81. Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0)
  82. Weld.C1 = CFrame.new(0, -1, -0.1)
  83. end
  84.  
  85. local Part = MasterPart1:Clone()
  86. Part.Name = "Grip Bottom"
  87. Part.Size = Vector3.new(0.2, 0.25, 0.2)
  88. Part.Parent = Parts
  89. Part.Mesh.Scale = Vector3.new(0.8, 1, 0.8)
  90. local Weld = Instance.new("Weld")
  91. Weld.Part0 = Part
  92. Weld.Part1 = MasterPart1
  93. Weld.C0 = CFrame.new(0, -0.375, 0)
  94. Weld.Parent = Weld.Part0
  95.  
  96. local Part = Part:Clone()
  97. Part.Name = "Grip Bump 1"
  98. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  99. Part.Parent = Parts
  100. Part.Mesh:Remove()
  101. local Mesh = Instance.new("SpecialMesh", Part)
  102. Mesh.MeshType = "FileMesh"
  103. Mesh.MeshId = "http://www.roblox.com/Asset/?id=1778999"
  104. Mesh.Scale = Vector3.new(0.15, 0.2, 0.15)
  105. local Weld = Instance.new("Weld")
  106. Weld.Part0 = Part
  107. Weld.Part1 = MasterPart1
  108. Weld.C0 = CFrame.new(0, -0.4125, 0)
  109. Weld.Parent = Weld.Part0
  110.  
  111. for i = 0, 1 do
  112. local Part = Part:Clone()
  113. Part.Name = "Grip Bump 2"
  114. Part.Parent = Parts
  115. Part.Mesh:Remove()
  116. local Mesh = Instance.new("SpecialMesh", Part)
  117. Mesh.MeshType = "Sphere"
  118. Mesh.Scale = Vector3.new(1, 0.4, 1)
  119. local Weld = Instance.new("Weld")
  120. Weld.Part0 = Part
  121. Weld.Part1 = MasterPart1
  122. Weld.C0 = CFrame.new(0, -0.375 + (0.05 * i), 0)
  123. Weld.Parent = Weld.Part0
  124. end
  125.  
  126. local Part = MasterPart1:Clone()
  127. Part.Name = "Bottom Ring 1"
  128. Part.BrickColor = BrickColor.new("Med stone grey")
  129. Part.Reflectance = 0.1
  130. Part.Size = Vector3.new(0.2, 0.2, 0.2)
  131. Part.Parent = Parts
  132. Part.Mesh.Scale = Vector3.new(0.8, 0.25, 0.8)
  133. local Weld = Instance.new("Weld")
  134. Weld.Part0 = Part
  135. Weld.Part1 = MasterPart1
  136. Weld.C0 = CFrame.new(0, -0.525, 0)
  137. Weld.Parent = Weld.Part0
  138.  
  139. local Part = Part:Clone()
  140. Part.Name = "Bottom Ring 2"
  141. Part.Parent = Parts
  142. Part.Mesh.Scale = Vector3.new(0.7, 0.25, 0.7)
  143. local Weld = Instance.new("Weld")
  144. Weld.Part0 = Part
  145. Weld.Part1 = MasterPart1
  146. Weld.C0 = CFrame.new(0, -0.575, 0)
  147. Weld.Parent = Weld.Part0
  148.  
  149. local Part = Part:Clone()
  150. Part.Name = "Bottom Ring 3"
  151. Part.Parent = Parts
  152. Part.Mesh.Scale = Vector3.new(0.75, 0.25, 0.75)
  153. local Weld = Instance.new("Weld")
  154. Weld.Part0 = Part
  155. Weld.Part1 = MasterPart1
  156. Weld.C0 = CFrame.new(0, -0.625, 0)
  157. Weld.Parent = Weld.Part0
  158.  
  159. for i = 0, 19 do
  160. local Part = Part:Clone()
  161. Part.Name = "Bottom Cap"
  162. Part.BrickColor = BrickColor.new("Really black")
  163. Part.Reflectance = 0
  164. Part.Parent = Parts
  165. Part.Mesh.Scale = Vector3.new(0.9 - (i * 0.01), 0.1, 0.9 - (i * 0.01))
  166. local Weld = Instance.new("Weld")
  167. Weld.Part0 = Part
  168. Weld.Part1 = MasterPart1
  169. Weld.C0 = CFrame.new(0, -0.66 - (i * 0.01), 0)
  170. Weld.Parent = Weld.Part0
  171. end
  172.  
  173. for i = 20, 26 do
  174. local Part = Part:Clone()
  175. Part.Name = "Bottom Cap"
  176. Part.Parent = Parts
  177. Part.BrickColor = BrickColor.new("Really black")
  178. Part.Reflectance = 0
  179. Part.Mesh.Scale = Vector3.new(0.9 - (i * 0.02), 0.1, 0.9 - (i * 0.02))
  180. local Weld = Instance.new("Weld")
  181. Weld.Part0 = Part
  182. Weld.Part1 = MasterPart1
  183. Weld.C0 = CFrame.new(0, -0.66 - (i * 0.01), 0)
  184. Weld.Parent = Weld.Part0
  185. end
  186.  
  187. local Part = Part:Clone()
  188. Part.Name = "Top Ring 1"
  189. Part.BrickColor = BrickColor.new("Med stone grey")
  190. Part.Reflectance = 0.1
  191. Part.Parent = Parts
  192. Part.Mesh.Scale = Vector3.new(1, 0.25, 1)
  193. local Weld = Instance.new("Weld")
  194. Weld.Part0 = Part
  195. Weld.Part1 = MasterPart1
  196. Weld.C0 = CFrame.new(0, 0.275, 0)
  197. Weld.Parent = Weld.Part0
  198.  
  199. local Part = Part:Clone()
  200. Part.Name = "Top Ring 2"
  201. Part.Parent = Parts
  202. Part.Mesh.Scale = Vector3.new(0.75, 0.125, 0.75)
  203. local Weld = Instance.new("Weld")
  204. Weld.Part0 = Part
  205. Weld.Part1 = MasterPart1
  206. Weld.C0 = CFrame.new(0, 0.3125, 0)
  207. Weld.Parent = Weld.Part0
  208.  
  209. local MasterPart2 = Part:Clone()
  210. MasterPart2.Name = "Top Handle"
  211. MasterPart2.Parent = Parts
  212. MasterPart2.Mesh.Scale = Vector3.new(0.75, 0.25, 0.75)
  213. local Weld = Instance.new("Weld")
  214. Weld.Part0 = MasterPart2
  215. Weld.Part1 = MasterPart1
  216. Weld.C0 = CFrame.new(0, 0.35, 0)
  217. Weld.Parent = Weld.Part0
  218.  
  219. local Part = MasterPart2:Clone()
  220. Part.Name = "Top Shaft Top"
  221. Part.Parent = Parts
  222. Part.Mesh.Scale = Vector3.new(0.4, 0.55, 0.4)
  223. local Weld = Instance.new("Weld")
  224. Weld.Part0 = Part
  225. Weld.Part1 = MasterPart2
  226. Weld.C0 = CFrame.new(0, -0.0775, 0)
  227. Weld.Parent = Weld.Part0
  228.  
  229. local Part = Part:Clone()
  230. Part.Name = "Top Shaft Center"
  231. Part.Parent = Parts
  232. Part.Mesh:Remove()
  233. local Mesh = Instance.new("SpecialMesh", Part)
  234. Mesh.MeshType = "Sphere"
  235. Mesh.Scale = Vector3.new(0.55, 0.55, 0.55)
  236. local Weld = Instance.new("Weld")
  237. Weld.Part0 = Part
  238. Weld.Part1 = MasterPart2
  239. Weld.C0 = CFrame.new(0, -0.0625, 0)
  240. Weld.Parent = Weld.Part0
  241.  
  242. local Part = MasterPart2:Clone()
  243. Part.Name = "Top Shaft Holder"
  244. Part.Parent = Parts
  245. Part.Mesh.Scale = Vector3.new(0.55, 0.1, 0.55)
  246. local Weld = Instance.new("Weld")
  247. Weld.Part0 = Part
  248. Weld.Part1 = MasterPart2
  249. Weld.C0 = CFrame.new(0, -0.1375, 0)
  250. Weld.Parent = Weld.Part0
  251.  
  252. local Part = Part:Clone()
  253. Part.Name = "Top Shaft Crystal Shell"
  254. Part.Parent = Parts
  255. Part.BrickColor = BrickColor.new("Institutional white")
  256. Part.Reflectance = 0
  257. Part.Transparency = 0.5
  258. Part.Mesh.Scale = Vector3.new(0.55, 0.8875, 0.55)
  259. local Weld = Instance.new("Weld")
  260. Weld.Part0 = Part
  261. Weld.Part1 = MasterPart2
  262. Weld.C0 = CFrame.new(0, -0.23625, 0)
  263. Weld.Parent = Weld.Part0
  264.  
  265. local Part = Part:Clone()
  266. Part.Name = "Top Shaft Crystal"
  267. Part.Parent = Parts
  268. Part.BrickColor = BrickColor.new("Really blue")
  269. Part.Reflectance = 0.5
  270. Part.Transparency = 0
  271. Part.Mesh.Scale = Vector3.new(0.2, 0.8875, 0.2)
  272. local Weld = Instance.new("Weld")
  273. Weld.Part0 = Part
  274. Weld.Part1 = MasterPart2
  275. Weld.C0 = CFrame.new(0, -0.23625, 0)
  276. Weld.Parent = Weld.Part0
  277.  
  278. local Part = MasterPart2:Clone()
  279. Part.Name = "Top Holder Bottom"
  280. Part.Parent = Parts
  281. Part.Mesh.Scale = Vector3.new(0.8, 0.25, 0.8)
  282. local Weld = Instance.new("Weld")
  283. Weld.Part0 = Part
  284. Weld.Part1 = MasterPart2
  285. Weld.C0 = CFrame.new(0, 0.05, 0)
  286. Weld.Parent = Weld.Part0
  287.  
  288. for i = 360 / 4, 360, 360 / 4 do
  289. local Part = Part:Clone()
  290. Part.Name = "Top Holder"
  291. Part.Parent = Parts
  292. Part.Size = Vector3.new(0.2, 0.25, 0.2)
  293. Part.Mesh:Remove()
  294. local Mesh = Instance.new("SpecialMesh", Part)
  295. Mesh.MeshType = "Brick"
  296. Mesh.Scale = Vector3.new(0.15, 1, 0.15)
  297. local Weld = Instance.new("Weld")
  298. Weld.Part0 = Part
  299. Weld.Part1 = MasterPart2
  300. Weld.C0 = CFrame.new(math.sin(math.rad(i)) * 0.075, 0.175, math.cos(math.rad(i)) * 0.075)
  301. Weld.Parent = Weld.Part0
  302. end
  303.  
  304. local Part = Part:Clone()
  305. Part.Name = "Top Center"
  306. Part.Parent = Parts
  307. Part.Size = Vector3.new(0.2, 0.25, 0.2)
  308. Part.Mesh.Scale = Vector3.new(0.3, 1, 0.3)
  309. local Weld = Instance.new("Weld")
  310. Weld.Part0 = Part
  311. Weld.Part1 = MasterPart2
  312. Weld.C0 = CFrame.new(0, 0.15, 0)
  313. Weld.Parent = Weld.Part0
  314.  
  315. local Part = Part:Clone()
  316. Part.Name = "Top Holder Top"
  317. Part.Parent = Parts
  318. Part.Mesh.Scale = Vector3.new(0.8, 0.25, 0.8)
  319. local Weld = Instance.new("Weld")
  320. Weld.Part0 = Part
  321. Weld.Part1 = MasterPart2
  322. Weld.C0 = CFrame.new(0, 0.3, 0)
  323. Weld.Parent = Weld.Part0
  324.  
  325. local Part = Part:Clone()
  326. Part.Name = "Crystal Base"
  327. Part.Parent = Parts
  328. Part.Reflectance = 0.3
  329. Part.BrickColor = BrickColor.new("Really blue")
  330. Part.Mesh.Scale = Vector3.new(0.75, 0.25, 0.75)
  331. local Weld = Instance.new("Weld")
  332. Weld.Part0 = Part
  333. Weld.Part1 = MasterPart2
  334. Weld.C0 = CFrame.new(0, 0.35, 0)
  335. Weld.Parent = Weld.Part0
  336.  
  337. local Part = Part:Clone()
  338. Part.Name = "Source"
  339. Part.Parent = Parts
  340. Part.Mesh:Remove()
  341. local Mesh = Instance.new("SpecialMesh", Part)
  342. Mesh.MeshType = "Sphere"
  343. Mesh.Scale = Vector3.new(0.75, 0.75, 0.75)
  344. local Weld = Instance.new("Weld")
  345. Weld.Part0 = Part
  346. Weld.Part1 = MasterPart2
  347. Weld.C0 = CFrame.new(0, 0.375, 0)
  348. Weld.Parent = Weld.Part0
  349. end
  350.  
  351.  
  352. function RemoveParts(Parent, Format)
  353. if Format == 1 then
  354. pcall(function() Parent[ModelName.. " (Holstered)"]:Remove() end)
  355. elseif Format == 2 then
  356. pcall(function() Parent[ModelName]:Remove() end)
  357. end
  358. end
  359.  
  360.  
  361. function SetAngle(Joint, Angle, Character)
  362. if Character == nil then return false end
  363. local Joints = {
  364. Character.Torso:FindFirstChild("Right Shoulder 2"),
  365. Character.Torso:FindFirstChild("Left Shoulder 2"),
  366. Character.Torso:FindFirstChild("Right Hip 2"),
  367. Character.Torso:FindFirstChild("Left Hip 2")
  368. }
  369. if Joints[Joint] == nil then return false end
  370. if Joint == 1 or Joint == 3 then
  371. Joints[Joint].DesiredAngle = Angle
  372. end
  373. if Joint == 2 or Joint == 4 then
  374. Joints[Joint].DesiredAngle = -Angle
  375. end
  376. end
  377.  
  378.  
  379. function ForceAngle(Joint, Angle, Character)
  380. if Character == nil then return false end
  381. local Joints = {
  382. Character.Torso:FindFirstChild("Right Shoulder 2"),
  383. Character.Torso:FindFirstChild("Left Shoulder 2"),
  384. Character.Torso:FindFirstChild("Right Hip 2"),
  385. Character.Torso:FindFirstChild("Left Hip 2")
  386. }
  387. if Joints[Joint] == nil then return false end
  388. if Joint == 1 or Joint == 3 then
  389. Joints[Joint].DesiredAngle = Angle
  390. Joints[Joint].CurrentAngle = Angle
  391. end
  392. if Joint == 2 or Joint == 4 then
  393. Joints[Joint].DesiredAngle = -Angle
  394. Joints[Joint].CurrentAngle = -Angle
  395. end
  396. end
  397.  
  398.  
  399. function SetSpeed(Joint, Speed, Character)
  400. if Character == nil then return false end
  401. local Joints = {
  402. Character.Torso:FindFirstChild("Right Shoulder 2"),
  403. Character.Torso:FindFirstChild("Left Shoulder 2"),
  404. Character.Torso:FindFirstChild("Right Hip 2"),
  405. Character.Torso:FindFirstChild("Left Hip 2")
  406. }
  407. if Joints[Joint] == nil then return false end
  408. Joints[Joint].MaxVelocity = Speed
  409. end
  410.  
  411.  
  412. function DisableLimb(Limb, Character)
  413. if Character == nil then return false end
  414. if Character:FindFirstChild("Torso") == nil then return false end
  415. local Joints = {
  416. Character.Torso:FindFirstChild("Right Shoulder"),
  417. Character.Torso:FindFirstChild("Left Shoulder"),
  418. Character.Torso:FindFirstChild("Right Hip"),
  419. Character.Torso:FindFirstChild("Left Hip")
  420. }
  421. local Limbs = {
  422. Character:FindFirstChild("Right Arm"),
  423. Character:FindFirstChild("Left Arm"),
  424. Character:FindFirstChild("Right Leg"),
  425. Character:FindFirstChild("Left Leg")
  426. }
  427. if Joints[Limb] == nil then return false end
  428. if Limbs[Limb] == nil then return false end
  429. local Joint = Instance.new("Motor")
  430. Joint.Parent = Character.Torso
  431. Joint.Part0 = Character.Torso
  432. Joint.Part1 = Limbs[Limb]
  433. if Limb == 1 then
  434. Joint.C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  435. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  436. Joint.Name = "Right Shoulder 2"
  437. elseif Limb == 2 then
  438. Joint.C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  439. Joint.C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  440. Joint.Name = "Left Shoulder 2"
  441. elseif Limb == 3 then
  442. Joint.C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  443. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  444. Joint.Name = "Right Hip 2"
  445. elseif Limb == 4 then
  446. Joint.C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  447. Joint.C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  448. Joint.Name = "Left Hip 2"
  449. end
  450. Joint.MaxVelocity = Joints[Limb].MaxVelocity
  451. Joint.CurrentAngle = Joints[Limb].CurrentAngle
  452. Joint.DesiredAngle = Joints[Limb].DesiredAngle
  453. Joints[Limb]:Remove()
  454. end
  455.  
  456.  
  457. function ResetLimbCFrame(Limb, Character)
  458. if Character == nil then return false end
  459. if Character.Parent == nil then return false end
  460. if Character:FindFirstChild("Torso") == nil then return false end
  461. local Joints = {
  462. Character.Torso:FindFirstChild("Right Shoulder 2"),
  463. Character.Torso:FindFirstChild("Left Shoulder 2"),
  464. Character.Torso:FindFirstChild("Right Hip 2"),
  465. Character.Torso:FindFirstChild("Left Hip 2")
  466. }
  467. local Limbs = {
  468. Character:FindFirstChild("Right Arm"),
  469. Character:FindFirstChild("Left Arm"),
  470. Character:FindFirstChild("Right Leg"),
  471. Character:FindFirstChild("Left Leg")
  472. }
  473. if Joints[Limb] == nil then return false end
  474. if Limbs[Limb] == nil then return false end
  475. if Limb == 1 then
  476. Joints[Limb].C0 = CFrame.new(1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  477. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  478. elseif Limb == 2 then
  479. Joints[Limb].C0 = CFrame.new(-1.5, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  480. Joints[Limb].C1 = CFrame.new(0, 0.5, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  481. elseif Limb == 3 then
  482. Joints[Limb].C0 = CFrame.new(0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  483. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(90), 0)
  484. elseif Limb == 4 then
  485. Joints[Limb].C0 = CFrame.new(-0.5, -1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  486. Joints[Limb].C1 = CFrame.new(0, 1, 0) * CFrame.fromEulerAnglesXYZ(0, math.rad(-90), 0)
  487. end
  488. end
  489.  
  490.  
  491. function EnableLimb(Limb, Character)
  492. if Character == nil then return false end
  493. if Character:FindFirstChild("Torso") == nil then return false end
  494. local Joints = {
  495. Character.Torso:FindFirstChild("Right Shoulder 2"),
  496. Character.Torso:FindFirstChild("Left Shoulder 2"),
  497. Character.Torso:FindFirstChild("Right Hip 2"),
  498. Character.Torso:FindFirstChild("Left Hip 2")
  499. }
  500. local Limbs = {
  501. Character:FindFirstChild("Right Arm"),
  502. Character:FindFirstChild("Left Arm"),
  503. Character:FindFirstChild("Right Leg"),
  504. Character:FindFirstChild("Left Leg")
  505. }
  506. if Joints[Limb] == nil then return false end
  507. if Limbs[Limb] == nil then return false end
  508. if Limb == 1 then
  509. Joints[Limb].Name = "Right Shoulder"
  510. elseif Limb == 2 then
  511. Joints[Limb].Name = "Left Shoulder"
  512. elseif Limb == 3 then
  513. Joints[Limb].Name = "Right Hip"
  514. elseif Limb == 4 then
  515. Joints[Limb].Name = "Left Hip"
  516. end
  517. Animate = Character:FindFirstChild("Animate")
  518. if Animate == nil then return false end
  519. Animate = Animate:Clone()
  520. Character.Animate:Remove()
  521. Animate.Parent = Character
  522. end
  523.  
  524.  
  525. function Weld(x, y)
  526. local Weld = Instance.new("Weld")
  527. Weld.Part0 = x
  528. Weld.Part1 = y
  529. Weld.C0 = x.CFrame:inverse() * CFrame.new(x.Position)
  530. Weld.C1 = y.CFrame:inverse() * CFrame.new(x.Position)
  531. Weld.Parent = x
  532. end
  533.  
  534.  
  535. function onButton1Down(Mouse)
  536. if Button1Down == true then return end
  537. Button1Down = true
  538. if CheckPlayer() == false then return end
  539. if CanUse == true then
  540. CanUse = false
  541. pcall(function()
  542. Player.Character[ModelName].Handle.Weld.C0 = CFrame.new(0, 0.5, -0.1)
  543. end)
  544. while Player.Character[ModelName].Handle:FindFirstChild("Waver") == nil do
  545. SoundToServer("Waver", "http://www.roblox.com/Asset/?id=15666462", 0, 0.1, true, Player.Character[ModelName].Handle)
  546. for i = 0, 1, 0.1 do
  547. if Player.Character[ModelName].Handle:FindFirstChild("Waver") ~= nil then break end
  548. wait()
  549. end
  550. end
  551. Player.Character[ModelName].Handle.Waver:Play()
  552. ForceAngle(1, 0, Player.Character)
  553. coroutine.wrap(function()
  554. local SourceBubble = CreateBrickBeam()
  555. SourceBubble.Name = "SSD Source Bubble"
  556. SourceBubble.Mesh.MeshType = "Sphere"
  557. while CanUse == false do
  558. SourceBubble.Parent = Workspace
  559. SourceBubble.CFrame = Player.Character[ModelName].Source.CFrame
  560. SourceBubble.Mesh.Scale = Vector3.new(1 / 0.2, 1 / 0.2, 1 / 0.2) * ((((math.sin(tick() * 10) + 1) / 2) * 2) + 0.5)
  561. SourceBubble.Transparency = (((math.sin(tick() * 10) + 1) / 2) * 0.25) + 0.25
  562. wait()
  563. end
  564. SourceBubble:Remove()
  565. end)()
  566. CanEdit = true
  567. local i = 0
  568. while Button1Down == true or CanEdit == false do
  569. if CanEdit == false then
  570. if i < 2 then
  571. i = i + 0.05
  572. else
  573. i = 2
  574. end
  575. else
  576. if i > 1 then
  577. i = i - 0.05
  578. else
  579. i = 1
  580. end
  581. end
  582. Player.Character[ModelName].Handle.Waver.Pitch = (math.cos(tick() * 10 * i) + 10 + ((i - 1) * 3)) + PitchMod
  583. Player.Character[ModelName].Source.Reflectance = math.random(30, 100) / 100
  584. Player.Character[ModelName]["Crystal Base"].Reflectance = Player.Character[ModelName].Source.Reflectance
  585. pcall(function()
  586. Player.Character.Torso["Right Shoulder 2"].C0 = CFrame.new(1.5, 0.5, 0)
  587. Player.Character.Torso["Right Shoulder 2"].C1 = CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0) * CFrame.new(0, 0, 0.5) * (CFrame.new((Player.Character.Torso.CFrame * CFrame.new(1.5, 0, 0)).p, Mouse.Hit.p) - (Player.Character.Torso.CFrame * CFrame.new(1.5, 0, 0)).p):inverse() * (Player.Character.Torso.CFrame - Player.Character.Torso.Position)
  588. end)
  589. wait()
  590. end
  591. CanEdit = false
  592. coroutine.wrap(function()
  593. Player.Character[ModelName].Handle.Waver:Stop()
  594. end)()
  595. ResetLimbCFrame(1, Player.Character)
  596. ForceAngle(1, math.rad(90), Player.Character)
  597. Player.Character[ModelName]["Crystal Base"].Reflectance = 0.3
  598. Player.Character[ModelName].Source.Reflectance = 0.3
  599. pcall(function()
  600. Player.Character[ModelName].Handle.Weld.C0 = CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 0)
  601. end)
  602. CanEdit = true
  603. CanUse = true
  604. end
  605. end
  606.  
  607.  
  608. function onButton1Up(Mouse)
  609. Button1Down = false
  610. end
  611.  
  612.  
  613. function onKeyDown(Key, Mouse)
  614. if Selected == false then return end
  615. Key = Key:lower()
  616. if CheckPlayer() == true then
  617. if Button1Down == false and CanUse == true then
  618. if Key == "q" then
  619. if Mouse.Target == nil then return end
  620. if CheckPlayer() == false then return end
  621. local NewPlayer = game:GetService("Players"):GetPlayerFromCharacter(Mouse.Target.Parent)
  622. if NewPlayer == nil then return end
  623. if NewPlayer.Character == nil then return end
  624. if NewPlayer.Character:FindFirstChild("Torso") == nil then return end
  625. if (NewPlayer.Character.Torso.Position - Player.Character.Torso.Position).magnitude > 10 then return end
  626. pcall(function() TARDISLink["TARDIS Link"]:Remove() end)
  627. TARDISLink = nil
  628. onDeselected(Mouse)
  629. wait()
  630. RemoveParts(Player.Character, 1)
  631. script.Parent.Parent = NewPlayer.Backpack
  632. Player = NewPlayer
  633. end
  634. end
  635. if Button1Down == true and CanEdit == true then
  636. local Beam = CreateBrickBeam()
  637. Instance.new("Model", Beam).Name = "SSD Removal"
  638. Beam.Parent = nil
  639. coroutine.wrap(function()
  640. Beam.Mesh.Scale = Vector3.new(0.25, 0.25, 0)
  641. wait()
  642. while true do
  643. if CanEdit == true then break end
  644. Beam.Mesh.Scale = Vector3.new(0.25, 0.25, (Mouse.Hit.p - Player.Character[ModelName].Source.Position).magnitude / 0.2)
  645. Beam.CFrame = CFrame.new((Player.Character[ModelName].Source.Position + Mouse.Hit.p) / 2, Mouse.Hit.p)
  646. wait()
  647. end
  648. Beam:Remove()
  649. end)()
  650. if Key == "e" then
  651. CanEdit = false
  652. KeyEDown = true
  653. while KeyEDown == true and Button1Down == true do
  654. if (Mouse.Hit.p - Player.Character.Torso.Position).magnitude > 35 then
  655. Beam.Parent = nil
  656. else
  657. Beam.Parent = Workspace
  658. if Mouse.Target ~= nil and math.random(1, 5) == 1 then
  659. if Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent.Parent:FindFirstChild("Humanoid") == nil then
  660. if Mouse.Target.Anchored == true and Mouse.Target:GetMass() < 1000 then Mouse.Target.Anchored = false end
  661. Mouse.Target:BreakJoints()
  662. end
  663. end
  664. end
  665. wait()
  666. end
  667. CanEdit = true
  668. elseif Key == "r" then
  669. CanEdit = false
  670. KeyRDown = true
  671. while KeyRDown == true and Button1Down == true do
  672. if (Mouse.Hit.p - Player.Character.Torso.Position).magnitude > 75 then
  673. Beam.Parent = nil
  674. else
  675. Beam.Parent = Workspace
  676. if Mouse.Target ~= nil then
  677. if Mouse.Target.Anchored == false and Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent.Parent:FindFirstChild("Humanoid") == nil then
  678. local BodyForce = Instance.new("BodyForce", Mouse.Target)
  679. BodyForce.force = (Mouse.Hit.p - Player.Character[ModelName].Source.Position).unit * 10000
  680. coroutine.wrap(function()
  681. wait(0.1)
  682. BodyForce:Remove()
  683. end)()
  684. end
  685. end
  686. end
  687. wait()
  688. end
  689. CanEdit = true
  690. elseif Key == "t" then
  691. CanEdit = false
  692. KeyTDown = true
  693. while KeyTDown == true and Button1Down == true do
  694. if (Mouse.Hit.p - Player.Character.Torso.Position).magnitude > 50 then
  695. Beam.Parent = nil
  696. else
  697. Beam.Parent = Workspace
  698. if Mouse.Target ~= nil and Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent.Parent:FindFirstChild("Humanoid") == nil then
  699. if Mouse.Target.Anchored == false then
  700. local BodyForce = Instance.new("BodyForce", Mouse.Target)
  701. BodyForce.force = (Player.Character[ModelName].Source.Position - Mouse.Hit.p).unit * 5000
  702. coroutine.wrap(function()
  703. wait(0.1)
  704. BodyForce:Remove()
  705. end)()
  706. end
  707. end
  708. end
  709. wait()
  710. end
  711. CanEdit = true
  712. elseif Key == "y" then
  713. CanEdit = false
  714. KeyYDown = true
  715. local OldTarget = game
  716. while KeyYDown == true do
  717. if (Mouse.Hit.p - Player.Character.Torso.Position).magnitude > 15 then
  718. Beam.Parent = nil
  719. else
  720. if Button1Down == true then
  721. Beam.Parent = Workspace
  722. if Player:FindFirstChild("PlayerGui") ~= nil then
  723. if Player.PlayerGui:FindFirstChild("SSDToolTip") ~= nil and OldTarget == Mouse.Target then
  724. Player.PlayerGui.SSDToolTip.Content.Position = UDim2.new(0, Mouse.X, 0, Mouse.Y)
  725. else
  726. pcall(function() Player.PlayerGui:FindFirstChild("SSDToolTip"):Remove() end)
  727. local Gui = Instance.new("ScreenGui", Player.PlayerGui)
  728. Gui.Name = "SSDToolTip"
  729. local Frame = Instance.new("Frame", Gui)
  730. Frame.Name = "Content"
  731. Frame.Size = UDim2.new(0, 300, 0, 45)
  732. Frame.Position = UDim2.new(0, Mouse.X - (300 / 2), 0, Mouse.Y)
  733. Frame.BorderColor3 = Color3.new(0, 0.3, 0)
  734. Frame.BackgroundColor3 = Color3.new(0, 0.7, 0)
  735. local TextLabel = Instance.new("TextLabel", Frame)
  736. TextLabel.Name = Mouse.Target.Name.. " Label"
  737. TextLabel.Text = "Editing: \"" ..Mouse.Target.Name.. "\"."
  738. TextLabel.Position = UDim2.new(0, 5, 0, 5)
  739. TextLabel.Size = UDim2.new(1, -10, 0, 15)
  740. TextLabel.FontSize = "Size12"
  741. TextLabel.BackgroundTransparency = 1
  742. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  743. if Mouse.Target ~= nil then
  744. OldTarget = Mouse.Target
  745. local i = 0
  746. for _, Part in pairs(Mouse.Target:GetChildren()) do
  747. if string.match(Part.ClassName, "Value") then
  748. i = i + 1
  749. Frame.Size = Frame.Size + UDim2.new(0, 0, 0, 15)
  750. local TextLabel = Instance.new("TextLabel", Frame)
  751. TextLabel.Name = Part.Name.. " Label"
  752. TextLabel.Text = Part.Name
  753. TextLabel.Position = UDim2.new(0, 5, 0, 15 + i * 15)
  754. TextLabel.FontSize = "Size12"
  755. TextLabel.BackgroundTransparency = 1
  756. TextLabel.TextColor3 = Color3.new(1, 1, 1)
  757. if Part.ClassName == "BoolValue" or Part.ClassName == "NumberValue" then
  758. TextLabel.Size = UDim2.new(1, -60, 0, 15)
  759. end
  760. local TextButton = Instance.new("TextButton", Frame)
  761. TextButton.Name = Part.Name
  762. TextButton.Text = tostring(Part.Value)
  763. TextButton.FontSize = "Size10"
  764. TextButton.BackgroundColor3 = Color3.new(0, 0.5, 0)
  765. TextButton.BorderColor3 = Color3.new(0, 0.4, 0)
  766. TextButton.TextColor3 = Color3.new(1, 1, 1)
  767. if Part.ClassName == "BoolValue" then
  768. TextButton.Position = UDim2.new(1, -55, 0, 15 + i * 15)
  769. TextButton.Size = UDim2.new(0, 50, 0, 15)
  770. TextButton.MouseButton1Up:connect(function()
  771. Part.Value = not Part.Value
  772. TextButton.Text = tostring(Part.Value)
  773. end)
  774. elseif Part.ClassName == "NumberValue" then
  775. TextButton.Text = tostring(Part.Value)
  776. TextButton.Position = UDim2.new(1, -45, 0, 15 + i * 15)
  777. TextButton.Size = UDim2.new(0, 30, 0, 15)
  778. TextButton.MouseButton1Up:connect(function()
  779. TextButton.Text = tostring(Part.Value)
  780. end)
  781. local TextButton1 = TextButton:Clone()
  782. TextButton1.Parent = Frame
  783. TextButton1.Name = Part.Name
  784. TextButton1.FontSize = "Size12"
  785. TextButton1.Text = "-"
  786. TextButton1.Position = UDim2.new(1, -55, 0, 15 + i * 15)
  787. TextButton1.Size = UDim2.new(0, 10, 0, 15)
  788. TextButton1.MouseButton1Up:connect(function()
  789. Part.Value = Part.Value - 1
  790. TextButton.Text = tostring(Part.Value)
  791. end)
  792. local TextButton2 = TextButton1:Clone()
  793. TextButton2.Parent = Frame
  794. TextButton2.Text = "+"
  795. TextButton2.Position = UDim2.new(1, -15, 0, 15 + i * 15)
  796. TextButton2.MouseButton1Up:connect(function()
  797. Part.Value = Part.Value + 1
  798. TextButton.Text = tostring(Part.Value)
  799. end)
  800. end
  801. end
  802. end
  803. end
  804. end
  805. end
  806. else
  807. Beam.Parent = nil
  808. end
  809. end
  810. wait()
  811. end
  812. if Player:FindFirstChild("PlayerGui") ~= nil then
  813. if Player.PlayerGui:FindFirstChild("SSDToolTip") ~= nil then
  814. Player.PlayerGui.SSDToolTip:Remove()
  815. end
  816. end
  817. CanEdit = true
  818. elseif Key == "u" then
  819. KeyUDown = true
  820. CanEdit = false
  821. if Mouse.Target ~= nil then
  822. if Mouse.Target.Anchored == false and (Mouse.Hit.p - Player.Character[ModelName].Source.Position).magnitude <= 15 and Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent.Parent:FindFirstChild("Humanoid") == nil then
  823. local Target = Mouse.Target
  824. local BodyPosition = Instance.new("BodyPosition", Target)
  825. BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  826. BodyPosition.P = 5000
  827. BodyPosition.D = 100
  828. while KeyUDown == true and Button1Down == true do
  829. if Player.Character == nil then break end
  830. if Player.Character:FindFirstChild("Humanoid") == nil then break end
  831. if Player.Character.Humanoid.Health <= 0 then break end
  832. Beam.Parent = Workspace
  833. Beam.Mesh.Scale = Vector3.new(Beam.Mesh.Scale.x, Beam.Mesh.Scale.y, (Target.Position - Player.Character[ModelName].Source.Position).magnitude / 0.2)
  834. Beam.CFrame = CFrame.new((Player.Character[ModelName].Source.Position + Target.Position) / 2, Target.Position)
  835. BodyPosition.position = Player.Character[ModelName].Source.Position + ((Mouse.Hit.p - Player.Character[ModelName].Source.Position).unit * 10)
  836. wait()
  837. end
  838. BodyPosition:Remove()
  839. end
  840. end
  841. CanEdit = true
  842. elseif Key == "p" then
  843. CanEdit = false
  844. KeyPDown = true
  845. while KeyPDown == true and Button1Down == true do
  846. if (Mouse.Hit.p - Player.Character.Torso.Position).magnitude > 10 then
  847. Beam.Parent = nil
  848. else
  849. Beam.Parent = Workspace
  850. if Mouse.Target ~= nil and Mouse.Target:FindFirstChild("SSD Removal") == nil then
  851. if Mouse.Target:GetMass() < 1000 and Mouse.Target.Parent:FindFirstChild("Humanoid") == nil and Mouse.Target.Parent.Parent:FindFirstChild("Humanoid") == nil then
  852. if Mouse.Target.Anchored == true then Mouse.Target.Anchored = false end
  853. Instance.new("Model", Mouse.Target).Name = "SSD Removal"
  854. coroutine.wrap(function()
  855. local Target = Mouse.Target
  856. if Target:FindFirstChild("Mesh") == nil then
  857. local Mesh = Instance.new("SpecialMesh", Target)
  858. Mesh.MeshType = "Brick"
  859. end
  860. local Scale = Target.Mesh.Scale
  861. for i = 1, 0, -math.random(1, 5) / 100 do
  862. pcall(function() Target.Mesh.Scale = Scale * i end)
  863. wait()
  864. end
  865. Target:Remove()
  866. end)()
  867. end
  868. end
  869. end
  870. wait()
  871. end
  872. CanEdit = true
  873. elseif Key == "f" then
  874. CanEdit = false
  875. KeyFDown = true
  876. local Light = Instance.new("Part", Workspace)
  877. Light.Name = "SSD Light"
  878. Light.FormFactor = "Custom"
  879. Light.TopSurface = 0
  880. Light.BottomSurface = 0
  881. Light.Anchored = true
  882. Light.CanCollide = false
  883. Light.Transparency = 0.5
  884. Light.Reflectance = 0.01
  885. Light.Size = Vector3.new(0.2, 0.2, 0.2)
  886. Light.BrickColor = BrickColor.new("Bright blue")
  887. local Mesh = Instance.new("SpecialMesh", Light)
  888. Mesh.MeshType = "FileMesh"
  889. Mesh.MeshId = "http://www.roblox.com/Asset/?id=1033714"
  890. Mesh.Scale = Vector3.new(10, 30, 10)
  891. local CastLightChildren = {}
  892. local CastLightReflectance = {}
  893. local function CastLightAct(Source)
  894. if Source == nil then Source = Workspace end
  895. for _, Part in pairs(Source:GetChildren()) do
  896. if Part:IsA("BasePart") and Part ~= Light then
  897. if (Part.Position - Light.Position).magnitude < 10 then
  898. table.insert(CastLightChildren, Part)
  899. table.insert(CastLightReflectance, Part.Reflectance)
  900. local Percent = 1 - ((Part.Position - Light.Position).magnitude / 10)
  901. if Percent < 0 then Percent = 0 end
  902. if Percent > 1 then Percent = 1 end
  903. Part.Reflectance = Percent
  904. if math.random(1, 10) == 1 then wait() end
  905. end
  906. end
  907. CastLightAct(Part)
  908. end
  909. end
  910. local function CastLight(On, Source)
  911. for i = 1, #CastLightChildren do
  912. CastLightChildren[i].Reflectance = CastLightReflectance[i]
  913. end
  914. CastLightChildren = {}
  915. CastLightReflectance = {}
  916. if On == true then
  917. CastLightAct(Source)
  918. end
  919. end
  920. while KeyFDown == true and Button1Down == true do
  921. Light.Parent = Workspace
  922. Light.CFrame = Player.Character[ModelName].Source.CFrame * CFrame.new(0, -11.5, 0)
  923. Light.Transparency = (((math.sin(tick() * 10) + 1) / 2) * 0.25) + 0.25
  924. CastLight(true)
  925. wait(0.1)
  926. end
  927. CastLight(false)
  928. Light:Remove()
  929. CanEdit = true
  930. elseif Key == "g" then
  931. CanEdit = false
  932. KeyGDown = true
  933. while KeyGDown == true and Button1Down == true do
  934. local Model = nil
  935. if Mouse.Target ~= nil then
  936. if Mouse.Target.Parent:FindFirstChild("Humanoid") ~= nil and Mouse.Target.Parent:FindFirstChild("Torso") then
  937. if (Player.Character[ModelName].Source.Position - Mouse.Target.Parent.Torso.Position).magnitude < 10 then
  938. Model = Mouse.Target.Parent
  939. end
  940. end
  941. end
  942. if Model == nil then
  943. if Player.Character:FindFirstChild("Humanoid") ~= nil and Player.Character:FindFirstChild("Torso") then
  944. Model = Player.Character
  945. end
  946. end
  947. if Model ~= nil then
  948. Model.Humanoid.Health = Model.Humanoid.Health + math.random(1, 250) / 100
  949. if Model:FindFirstChild("Right Arm") == nil and math.random(1, 25) == 1 then
  950. local Limb = Instance.new("Part")
  951. Limb.Name = "Right Arm"
  952. pcall(function() Limb.BrickColor = BrickColor.new(tostring(Model["Body Colors"].RightArmColor)) end)
  953. Limb.FormFactor = 0
  954. Limb.Size = Vector3.new(1, 2, 1)
  955. Limb.Parent = Model
  956. Instance.new("Motor6D", Model.Torso).Name = "Right Shoulder"
  957. DisableLimb(1, Model)
  958. EnableLimb(1, Model)
  959. end
  960. if Model:FindFirstChild("Left Arm") == nil and math.random(1, 25) == 1 then
  961. local Limb = Instance.new("Part")
  962. Limb.Name = "Left Arm"
  963. pcall(function() Limb.BrickColor = BrickColor.new(tostring(Model["Body Colors"].LeftArmColor)) end)
  964. Limb.FormFactor = 0
  965. Limb.Size = Vector3.new(1, 2, 1)
  966. Limb.Parent = Model
  967. Instance.new("Motor6D", Model.Torso).Name = "Left Shoulder"
  968. DisableLimb(2, Model)
  969. EnableLimb(2, Model)
  970. end
  971. if Model:FindFirstChild("Right Leg") == nil and math.random(1, 25) == 1 then
  972. local Limb = Instance.new("Part")
  973. Limb.Name = "Right Leg"
  974. pcall(function() Limb.BrickColor = BrickColor.new(tostring(Model["Body Colors"].RightLegColor)) end)
  975. Limb.TopSurface = 0
  976. Limb.BottomSurface = 0
  977. Limb.FormFactor = 0
  978. Limb.Size = Vector3.new(1, 2, 1)
  979. Limb.Parent = Model
  980. Instance.new("Motor6D", Model.Torso).Name = "Right Hip"
  981. DisableLimb(3, Model)
  982. EnableLimb(3, Model)
  983. DisableLimb(3, Model)
  984. SetSpeed(3, 0.1, Model)
  985. EnableLimb(3, Model)
  986. end
  987. if Model:FindFirstChild("Left Leg") == nil and math.random(1, 25) == 1 then
  988. local Limb = Instance.new("Part")
  989. Limb.Name = "Left Leg"
  990. pcall(function() Limb.BrickColor = BrickColor.new(tostring(Model["Body Colors"].LeftLegColor)) end)
  991. Limb.TopSurface = 0
  992. Limb.BottomSurface = 0
  993. Limb.FormFactor = 0
  994. Limb.Size = Vector3.new(1, 2, 1)
  995. Limb.Parent = Model
  996. Instance.new("Motor6D", Model.Torso).Name = "Left Hip"
  997. DisableLimb(4, Model)
  998. EnableLimb(4, Model)
  999. DisableLimb(4, Model)
  1000. SetSpeed(4, 0.1, Model)
  1001. EnableLimb(4, Model)
  1002. end
  1003. local Confirm = Instance.new("Part", Workspace)
  1004. Confirm.Name = "SSD Confirm Bubble"
  1005. Confirm.BrickColor = BrickColor.new("Br. yellowish orange")
  1006. Confirm.FormFactor = "Custom"
  1007. Confirm.TopSurface = 0
  1008. Confirm.BottomSurface = 0
  1009. Confirm.Anchored = true
  1010. Confirm.CanCollide = false
  1011. Confirm.Size = Vector3.new(0.2, 0.2, 0.2)
  1012. Confirm.CFrame = Model.Torso.CFrame * CFrame.new(math.random(-200, 200) / 100, math.random(-300, 200) / 100, math.random(-100, 100) / 100)
  1013. pcall(function() Confirm.Mesh:Remove() end)
  1014. local Mesh = Instance.new("SpecialMesh", Confirm)
  1015. Mesh.MeshType = "Sphere"
  1016. game:GetService("Debris"):AddItem(Confirm, 10)
  1017. coroutine.wrap(function()
  1018. local X, Z = math.random(-250, 250) / 5000, math.random(-250, 250) / 5000
  1019. for i = 0, 1, 0.05 do
  1020. Confirm.Transparency = i
  1021. Confirm.Mesh.Scale = Vector3.new(i * 25, i * 25, i * 25)
  1022. Confirm.CFrame = Confirm.CFrame * CFrame.new(X, math.sin(i * math.pi * 2.5) / 5, Z)
  1023. wait()
  1024. end
  1025. Confirm:Remove()
  1026. end)()
  1027. end
  1028. wait()
  1029. end
  1030. CanEdit = true
  1031. elseif Key == "h" then
  1032. CanEdit = false
  1033. KeyHDown = true
  1034. while KeyHDown == true and Button1Down == true do
  1035. if KeyHStatus == nil then KeyHStatus = 0 end
  1036. KeyHStatus = KeyHStatus + 0.5
  1037. PitchMod = (KeyHStatus / 100) * 5
  1038. local KeyHBeam = CreateBrickBeam(Player.Character[ModelName].Source.Position, Player.Character[ModelName].Source.Position + Vector3.new(math.random((-KeyHStatus / 100) * 25, (KeyHStatus / 100) * 25), math.random((-KeyHStatus / 100) * 25, (KeyHStatus / 100) * 25), math.random((-KeyHStatus / 100) * 25, (KeyHStatus / 100) * 25)))
  1039. coroutine.wrap(function()
  1040. for i = 0, 1, 0.05 do
  1041. local OldPosition = KeyHBeam.CFrame
  1042. KeyHBeam.Size = Beam.Size + Vector3.new((KeyHStatus / 100) * 5, (KeyHStatus / 100) * 5, 0)
  1043. KeyHBeam.CFrame = OldPosition
  1044. KeyHBeam.Transparency = i
  1045. wait()
  1046. end
  1047. KeyHBeam:Remove()
  1048. end)()
  1049. if KeyHStatus == 100 then
  1050. KeyHDown = false
  1051. CanEdit = true
  1052. Button1Down = false
  1053. wait(0.1)
  1054. Player.Character:BreakJoints()
  1055. local Explosion = Instance.new("Explosion")
  1056. Explosion.Position = Player.Character.Torso.Position
  1057. Explosion.BlastPressure = 100000
  1058. Explosion.BlastRadius = 50
  1059. Explosion.Parent = Workspace
  1060. local Confirm = Beam:Clone()
  1061. Confirm.Parent = Workspace
  1062. Confirm.Name = "SSD Confirm Bubble"
  1063. Confirm.BrickColor = BrickColor.new("Really white")
  1064. Confirm.Size = Vector3.new(1, 1, 1)
  1065. Confirm.CFrame = Player.Character.Torso.CFrame
  1066. pcall(function() Confirm.Mesh:Remove() end)
  1067. local Mesh = Instance.new("SpecialMesh", Confirm)
  1068. Mesh.MeshType = "Sphere"
  1069. game:GetService("Debris"):AddItem(Confirm, 10)
  1070. coroutine.wrap(function()
  1071. for i = 0, 1, 0.01 do
  1072. Confirm.Transparency = i
  1073. Confirm.Mesh.Scale = Vector3.new(i * 100, i * 100, i * 100)
  1074. wait()
  1075. end
  1076. Confirm:Remove()
  1077. end)()
  1078. onDeselected(Mouse)
  1079. end
  1080. wait()
  1081. end
  1082. while KeyHDown == false and KeyHStatus > 0 do
  1083. KeyHStatus = KeyHStatus - 1
  1084. PitchMod = (KeyHStatus / 100) * 5
  1085. wait()
  1086. end
  1087. KeyHStatus = 0
  1088. CanEdit = true
  1089. elseif Key == "j" then
  1090. KeyJDown = true
  1091. CanEdit = false
  1092. if Mouse.Target ~= nil then
  1093. if (Mouse.Hit.p - Player.Character[ModelName].Source.Position).magnitude <= 15 then
  1094. local Target = Mouse.Target
  1095. local Offset = CFrame.new(Mouse.Hit.p - Target.Position)
  1096. local BodyPosition = Instance.new("BodyPosition", Player.Character.Torso)
  1097. BodyPosition.maxForce = Vector3.new(math.huge, math.huge, math.huge)
  1098. BodyPosition.P = 5000
  1099. BodyPosition.D = 1000
  1100. while KeyJDown == true and Button1Down == true do
  1101. if Player.Character == nil then break end
  1102. if Player.Character:FindFirstChild("Humanoid") == nil then break end
  1103. if Player.Character.Humanoid.Health <= 0 then break end
  1104. Beam.Parent = Workspace
  1105. Beam.Mesh.Scale = Vector3.new(Beam.Mesh.Scale.x, Beam.Mesh.Scale.y, ((Target.CFrame * Offset).p - Player.Character[ModelName].Source.Position).magnitude / 0.2)
  1106. Beam.CFrame = CFrame.new((Player.Character[ModelName].Source.Position + (Target.CFrame * Offset).p) / 2, (Target.CFrame * Offset).p)
  1107. BodyPosition.position = (Target.CFrame * Offset).p + ((Player.Character[ModelName].Source.Position - Mouse.Hit.p).unit * 10)
  1108. wait()
  1109. end
  1110. BodyPosition:Remove()
  1111. end
  1112. end
  1113. CanEdit = true
  1114. elseif Key == "k" then
  1115. CanEdit = false
  1116. if TARDISLink ~= nil then
  1117. pcall(function() TARDISLink["TARDIS Link"]:Remove() end)
  1118. TARDISLink = nil
  1119. else
  1120. local Hint = Instance.new("Hint", Player:FindFirstChild("PlayerGui"))
  1121. coroutine.wrap(function()
  1122. wait()
  1123. while string.match(Hint.Text, "Linking TARDIS") do wait() end
  1124. wait(2.5)
  1125. Hint:Remove()
  1126. end)()
  1127. Hint.Text = "[Sonic Screwdriver] No TARDIS in range!"
  1128. if Mouse.Target ~= nil then
  1129. if (Mouse.Hit.p - Player.Character[ModelName].Source.Position).magnitude <= 15 then
  1130. if Mouse.Target.Parent.Parent.Name == "TARDIS" then
  1131. if Mouse.Target.Parent.Parent:FindFirstChild("TARDIS Link") ~= nil then
  1132. Hint.Text = "[Sonic Screwdriver] This TARDIS is already linked!"
  1133. else
  1134. TARDISLink = Mouse.Target.Parent.Parent
  1135. local Link = Instance.new("IntValue", TARDISLink)
  1136. Link.Name = "TARDIS Link"
  1137. for i = 1, math.random(3, 50) do
  1138. Hint.Text = string.rep(" ", i).. "[Sonic Screwdriver] Linking TARDIS" ..string.rep(".", i)
  1139. if Link.Parent == nil then break end
  1140. wait(math.random(1, 25) / 100)
  1141. end
  1142. Hint.Text = "[Sonic Screwdriver] TARDIS linked!"
  1143. coroutine.wrap(function()
  1144. while Link.Parent ~= nil do
  1145. wait()
  1146. end
  1147. Hint.Parent = Player:FindFirstChild("PlayerGui")
  1148. Hint.Text = "[Sonic Screwdriver] TARDIS link broken!"
  1149. Link:Remove()
  1150. TARDISLink = nil
  1151. wait(2.5)
  1152. Hint:Remove()
  1153. end)()
  1154. end
  1155. end
  1156. end
  1157. end
  1158. end
  1159. CanEdit = true
  1160. elseif Key == "l" then
  1161. CanEdit = false
  1162. local Hint = Instance.new("Hint", Player:FindFirstChild("PlayerGui"))
  1163. coroutine.wrap(function()
  1164. wait()
  1165. while string.match(Hint.Text, "Sending data to TARDIS") do wait() end
  1166. wait(2.5)
  1167. Hint:Remove()
  1168. end)()
  1169. if TARDISLink ~= nil then
  1170. if (Mouse.Hit.p - Player.Character[ModelName].Source.Position).magnitude <= 50 then
  1171. for i = 1, math.random(3, 10) do
  1172. Hint.Text = string.rep(" ", i).. "[Sonic Screwdriver] Sending data to TARDIS" ..string.rep(".", i)
  1173. wait(math.random(1, 25) / 100)
  1174. end
  1175. TARDISLink.Teleport.Value = Mouse.Hit.p
  1176. Hint.Text = "[Sonic Screwdriver] Teleporting..."
  1177. else
  1178. Hint.Text = "[Sonic Screwdriver] Target destination too far!"
  1179. end
  1180. else
  1181. Hint.Text = "[Sonic Screwdriver] No TARDIS linked!"
  1182. end
  1183. CanEdit = true
  1184. elseif Key == "z" then
  1185. CanEdit = false
  1186. KeyZDown = true
  1187. if TARDISLink ~= nil then
  1188. while KeyZDown == true and TARDISLink ~= nil do
  1189. TARDISLink.Fly.Value = (Mouse.Hit.p - TARDISLink.Exterior.Base.Position).unit
  1190. wait()
  1191. end
  1192. else
  1193. coroutine.wrap(function()
  1194. local Hint = Instance.new("Hint", Player:FindFirstChild("PlayerGui"))
  1195. Hint.Text = "[Sonic Screwdriver] No TARDIS linked!"
  1196. wait(2.5)
  1197. Hint:Remove()
  1198. end)()
  1199. end
  1200. pcall(function() TARDISLink.Fly.Value = Vector3.new() end)
  1201. CanEdit = true
  1202. elseif Key == "x" then
  1203. CanEdit = false
  1204. local Hint = Instance.new("Hint", Player:FindFirstChild("PlayerGui"))
  1205. coroutine.wrap(function()
  1206. wait()
  1207. while string.match(Hint.Text, "Sending data to TARDIS") do wait() end
  1208. wait(2.5)
  1209. Hint:Remove()
  1210. end)()
  1211. if TARDISLink ~= nil then
  1212. for i = 1, math.random(1, 3) do
  1213. Hint.Text = string.rep(" ", i).. "[Sonic Screwdriver] Sending data to TARDIS" ..string.rep(".", i)
  1214. wait(math.random(1, 25) / 100)
  1215. end
  1216. TARDISLink.Stabalize.Value = true
  1217. Hint.Text = "[Sonic Screwdriver] TARDIS stabalized."
  1218. else
  1219. Hint.Text = "[Sonic Screwdriver] No TARDIS linked!"
  1220. end
  1221. CanEdit = true
  1222. end
  1223. end
  1224. end
  1225. end
  1226.  
  1227.  
  1228. function onKeyUp(Key, Mouse)
  1229. if Selected == false then return end
  1230. Key = Key:lower()
  1231. if Key == "e" then
  1232. KeyEDown = false
  1233. elseif Key == "r" then
  1234. KeyRDown = false
  1235. elseif Key == "t" then
  1236. KeyTDown = false
  1237. elseif Key == "y" then
  1238. KeyYDown = false
  1239. elseif Key == "u" then
  1240. KeyUDown = false
  1241. elseif Key == "p" then
  1242. KeyPDown = false
  1243. elseif Key == "f" then
  1244. KeyFDown = false
  1245. elseif Key == "g" then
  1246. KeyGDown = false
  1247. elseif Key == "h" then
  1248. KeyHDown = false
  1249. elseif Key == "j" then
  1250. KeyJDown = false
  1251. elseif Key == "z" then
  1252. KeyZDown = false
  1253. end
  1254. end
  1255.  
  1256.  
  1257. function onSelected(Mouse)
  1258. if Selected == true or CanUse == false then return end
  1259. CanUse = false
  1260. while true do
  1261. if CheckPlayer() == true then
  1262. if Player.Character.Torso:FindFirstChild("Right Shoulder") ~= nil then
  1263. break
  1264. end
  1265. end
  1266. wait(0.1)
  1267. end
  1268. Selected = true
  1269. RemoveParts(Player.Character, 1)
  1270. CreateParts(Player.Character, 2)
  1271. DisableLimb(1, Player.Character)
  1272. SetSpeed(1, 0.5, Player.Character)
  1273. SetAngle(1, math.rad(90), Player.Character)
  1274. wait(0.1)
  1275. SoundToServer("Click", "http://www.roblox.com/Asset/?id=14863866", 3, 1, false, Player.Character[ModelName].Handle)
  1276. for i = 0.35, 0.65, 0.05 do
  1277. pcall(function()
  1278. Player.Character[ModelName]["Top Handle"].Weld.C0 = CFrame.new(0, i, 0)
  1279. end)
  1280. wait()
  1281. end
  1282. pcall(function()
  1283. Player.Character[ModelName]["Top Handle"].Weld.C0 = CFrame.new(0, 0.65, 0)
  1284. end)
  1285. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  1286. Mouse.Button1Down:connect(function() onButton1Down(Mouse) end)
  1287. Mouse.Button1Up:connect(function() onButton1Up(Mouse) end)
  1288. Mouse.KeyDown:connect(function(Key) onKeyDown(Key, Mouse) end)
  1289. Mouse.KeyUp:connect(function(Key) onKeyUp(Key, Mouse) end)
  1290. CanUse = true
  1291. end
  1292.  
  1293.  
  1294. function onDeselected(Mouse)
  1295. if Selected == false then return end
  1296. Selected = false
  1297. Button1Down = false
  1298. while CanUse == false do wait() end
  1299. if CheckPlayer() == false or pcall(function() local _ = Player.Character.Torso["Right Shoulder 2"] end) == false then
  1300. RemoveParts(Player.Character, 2)
  1301. CreateParts(Player.Character, 1)
  1302. SetSpeed(1, 0.25, Player.Character)
  1303. SetAngle(1, 0, Player.Character)
  1304. ResetLimbCFrame(1, Player.Character)
  1305. EnableLimb(1, Player.Character)
  1306. return
  1307. end
  1308. if Selected == true then return end
  1309. CanUse = false
  1310. SoundToServer("Click", "http://www.roblox.com/Asset/?id=14863866", 3, 1, false, Player.Character[ModelName].Handle)
  1311. for i = 0.65, 0.35, -0.025 do
  1312. pcall(function()
  1313. Player.Character[ModelName]["Top Handle"].Weld.C0 = CFrame.new(0, i, 0)
  1314. end)
  1315. wait()
  1316. end
  1317. pcall(function()
  1318. Player.Character[ModelName]["Top Handle"].Weld.C0 = CFrame.new(0, 0.35, 0)
  1319. end)
  1320. wait(0.05)
  1321. RemoveParts(Player.Character, 2)
  1322. CreateParts(Player.Character, 1)
  1323. SetSpeed(1, 0.25, Player.Character)
  1324. SetAngle(1, 0, Player.Character)
  1325. ResetLimbCFrame(1, Player.Character)
  1326. EnableLimb(1, Player.Character)
  1327. CanUse = true
  1328. end
  1329.  
  1330.  
  1331. if script.Parent.ClassName ~= "HopperBin" then
  1332. if Player == nil then print("Error: Player not found!") return end
  1333. Tool = Instance.new("HopperBin")
  1334. Tool.Name = ModelName
  1335. Tool.Parent = Player.Backpack
  1336. script.Name = "Main"
  1337. script.Parent = Tool
  1338. elseif script.Parent.ClassName == "HopperBin" and Connected == false then
  1339. Connected = true
  1340. Player = script.Parent.Parent.Parent
  1341. end wait() if script.Parent.ClassName == "HopperBin" then
  1342. while script.Parent.Parent.ClassName ~= "Backpack" do
  1343. wait()
  1344. end
  1345. script.Parent.Selected:connect(onSelected)
  1346. script.Parent.Deselected:connect(onDeselected)
  1347. CreateParts(Player.Character, 1)
  1348. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement