Advertisement
firebudgy

Untitled

May 19th, 2018
477
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.77 KB | None | 0 0
  1.  
  2. --Converted with ttyyuu12345's model to script plugin v4
  3. function sandbox(var,func)
  4. local env = getfenv(func)
  5. local newenv = setmetatable({},{
  6. __index = function(self,k)
  7. if k=="script" then
  8. return var
  9. else
  10. return env[k]
  11. end
  12. end,
  13. })
  14. setfenv(func,newenv)
  15. return func
  16. end
  17. cors = {}
  18. mas = Instance.new("Model",game:GetService("Lighting"))
  19. Tool0 = Instance.new("Tool")
  20. Script1 = Instance.new("Script")
  21. Script2 = Instance.new("Script")
  22. Script3 = Instance.new("Script")
  23. LocalScript4 = Instance.new("LocalScript")
  24. LocalScript5 = Instance.new("LocalScript")
  25. LocalScript6 = Instance.new("LocalScript")
  26. Part7 = Instance.new("Part")
  27. Sound8 = Instance.new("Sound")
  28. Sound9 = Instance.new("Sound")
  29. SpecialMesh10 = Instance.new("SpecialMesh")
  30. Script11 = Instance.new("Script")
  31. Tool12 = Instance.new("Tool")
  32. Part13 = Instance.new("Part")
  33. SpecialMesh14 = Instance.new("SpecialMesh")
  34. Script15 = Instance.new("Script")
  35. LocalScript16 = Instance.new("LocalScript")
  36. Script17 = Instance.new("Script")
  37. Script18 = Instance.new("Script")
  38. SpecialMesh19 = Instance.new("SpecialMesh")
  39. Tool0.Name = "ParalyzerStunGun"
  40. Tool0.Parent = mas
  41. Tool0.TextureId = "http://www.roblox.com/asset/?id=13505853"
  42. Tool0.GripForward = Vector3.new(-0, 1, -0)
  43. Tool0.GripPos = Vector3.new(0, -0.600000024, -0.550000012)
  44. Tool0.GripUp = Vector3.new(0, 0, 1)
  45. Script1.Name = "LaserBlast"
  46. Script1.Parent = Tool0
  47. table.insert(cors,sandbox(Script1,function()
  48. ball = script.Parent
  49.  
  50.  
  51.  
  52. function onTouched(hit)
  53. local humanoid = hit.Parent:findFirstChild("Humanoid")
  54.  
  55. if humanoid ~= nil and hit.Parent:findFirstChild("RagdollScript") == nil then
  56. script.RagdollScript:Clone().Parent = humanoid.Parent
  57. hit.archivable = true
  58. hit.Locked = false
  59. end
  60. end
  61.  
  62. connection = ball.Touched:connect(onTouched)
  63.  
  64. wait(10)
  65. ball.Parent = nil
  66.  
  67. end))
  68. Script2.Name = "RagdollScript"
  69. Script2.Parent = Script1
  70. table.insert(cors,sandbox(Script2,function()
  71. Character = script.Parent
  72. Torso = Character.Torso
  73. if Character then
  74. if Torso then
  75. Humanoid = Character:findFirstChild("Humanoid")
  76. Zombie = Character:findFirstChild("Zombie")
  77. if Humanoid ~= nil then
  78. Humanoid.PlatformStand = true
  79. end
  80.  
  81. if Zombie ~= nil then
  82. Zombie.PlatformStand = true
  83. end
  84.  
  85. local Head = Character:FindFirstChild("Head")
  86. if Head then
  87. local Neck = Instance.new("Weld")
  88. Neck.Name = "Neck"
  89. Neck.Part0 = Torso
  90. Neck.Part1 = Head
  91. Neck.C0 = CFrame.new(0, 1.5, 0)
  92. Neck.C1 = CFrame.new()
  93. Neck.Parent = Torso
  94. end
  95. local Limb = Character:FindFirstChild("Right Arm")
  96. if Limb then
  97.  
  98. Limb.CFrame = Torso.CFrame * CFrame.new(1.5, 0, 0)
  99. local Joint = Instance.new("Glue")
  100. Joint.Name = "RightShoulder"
  101. Joint.Part0 = Torso
  102. Joint.Part1 = Limb
  103. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  104. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  105. Joint.Parent = Torso
  106.  
  107. local B = Instance.new("Part")
  108. B.TopSurface = 0
  109. B.BottomSurface = 0
  110. B.formFactor = "Symmetric"
  111. B.Size = Vector3.new(1, 1, 1)
  112. B.Transparency = 1
  113. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  114. B.Parent = Character
  115. local W = Instance.new("Weld")
  116. W.Part0 = Limb
  117. W.Part1 = B
  118. W.C0 = CFrame.new(0, -0.5, 0)
  119. W.Parent = Limb
  120.  
  121. end
  122. local Limb = Character:FindFirstChild("Left Arm")
  123. if Limb then
  124.  
  125. Limb.CFrame = Torso.CFrame * CFrame.new(-1.5, 0, 0)
  126. local Joint = Instance.new("Glue")
  127. Joint.Name = "LeftShoulder"
  128. Joint.Part0 = Torso
  129. Joint.Part1 = Limb
  130. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  131. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  132. Joint.Parent = Torso
  133.  
  134. local B = Instance.new("Part")
  135. B.TopSurface = 0
  136. B.BottomSurface = 0
  137. B.formFactor = "Symmetric"
  138. B.Size = Vector3.new(1, 1, 1)
  139. B.Transparency = 1
  140. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  141. B.Parent = Character
  142. local W = Instance.new("Weld")
  143. W.Part0 = Limb
  144. W.Part1 = B
  145. W.C0 = CFrame.new(0, -0.5, 0)
  146. W.Parent = Limb
  147.  
  148. end
  149. local Limb = Character:FindFirstChild("Right Leg")
  150. if Limb then
  151.  
  152. Limb.CFrame = Torso.CFrame * CFrame.new(0.5, -2, 4)
  153. local Joint = Instance.new("Glue")
  154. Joint.Name = "RightHip"
  155. Joint.Part0 = Torso
  156. Joint.Part1 = Limb
  157. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  158. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  159. Joint.Parent = Torso
  160.  
  161. local B = Instance.new("Part")
  162. B.TopSurface = 0
  163. B.BottomSurface = 0
  164. B.formFactor = "Symmetric"
  165. B.Size = Vector3.new(1, 1, 1)
  166. B.Transparency = 1
  167. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  168. B.Parent = Character
  169. local W = Instance.new("Weld")
  170. W.Part0 = Limb
  171. W.Part1 = B
  172. W.C0 = CFrame.new(0, -0.5, 0)
  173. W.Parent = Limb
  174.  
  175. end
  176. local Limb = Character:FindFirstChild("Left Leg")
  177. if Limb then
  178.  
  179. Limb.CFrame = Torso.CFrame * CFrame.new(-0.5, -2, 3)
  180. local Joint = Instance.new("Glue")
  181. Joint.Name = "LeftHip"
  182. Joint.Part0 = Torso
  183. Joint.Part1 = Limb
  184. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  185. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  186. Joint.Parent = Torso
  187.  
  188. local B = Instance.new("Part")
  189. B.TopSurface = 0
  190. B.BottomSurface = 0
  191. B.formFactor = "Symmetric"
  192. B.Size = Vector3.new(1, 1, 1)
  193. B.Transparency = 1
  194. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  195. B.Parent = Character
  196. local W = Instance.new("Weld")
  197. W.Part0 = Limb
  198. W.Part1 = B
  199. W.C0 = CFrame.new(0, -0.5, 0)
  200. W.Parent = Limb
  201.  
  202. end
  203. --[
  204. local Bar = Instance.new("Part")
  205. Bar.TopSurface = 0
  206. Bar.BottomSurface = 0
  207. Bar.formFactor = "Symmetric"
  208. Bar.Size = Vector3.new(1, 1, 1)
  209. Bar.Transparency = 1
  210. Bar.CFrame = Torso.CFrame * CFrame.new(0, 0.5, 0)
  211. Bar.Parent = Character
  212. local Weld = Instance.new("Weld")
  213. Weld.Part0 = Torso
  214. Weld.Part1 = Bar
  215. Weld.C0 = CFrame.new(0, 0.5, 0)
  216. Weld.Parent = Torso
  217. --]]
  218. end
  219. end
  220.  
  221.  
  222. end))
  223. Script3.Name = "RayGun"
  224. Script3.Parent = Tool0
  225. table.insert(cors,sandbox(Script3,function()
  226. local Tool = script.Parent;
  227.  
  228. enabled = true
  229.  
  230. local spark = Instance.new("Sparkles")
  231. spark.Color = Color3.new(5,2,9)
  232.  
  233. function fire(v)
  234.  
  235. local vCharacter = Tool.Parent
  236. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  237.  
  238. local missile = Instance.new("Part")
  239.  
  240.  
  241. spark:Clone().Parent = missile
  242.  
  243. local spawnPos = vCharacter.PrimaryPart.Position
  244.  
  245. local PewPew = Tool.Handle:FindFirstChild("PewPew")
  246.  
  247. if (PewPew == nil) then
  248. PewPew = Instance.new("Sound")
  249. PewPew.Name = "PewPew"
  250. PewPew.SoundId = "http://www.roblox.com/asset/?id=13775480"
  251. PewPew.Parent = Tool.Handle
  252. PewPew.Volume = 1
  253. end
  254.  
  255.  
  256. spawnPos = spawnPos + (v * 10)
  257.  
  258.  
  259. missile.Position = spawnPos
  260. missile.Size = Vector3.new(1,1,1)
  261. missile.Velocity = v * 180
  262. missile.BrickColor = BrickColor.new(1006)
  263. missile.Shape = 0
  264. missile.BottomSurface = 0
  265. missile.TopSurface = 0
  266. missile.Name = "Spark"
  267. missile.Reflectance = .3
  268.  
  269.  
  270. local force = Instance.new("BodyForce")
  271. force.force = Vector3.new(0,98,0)
  272. force.Parent = missile
  273.  
  274. local creator_tag = Instance.new("ObjectValue")
  275. creator_tag.Value = vPlayer
  276. creator_tag.Name = "creator"
  277. creator_tag.Parent = missile
  278.  
  279. local new_script = script.Parent.LaserBlast:clone()
  280. new_script.Disabled = false
  281. new_script.Parent = missile
  282.  
  283. missile.Parent = game.Workspace
  284.  
  285. PewPew:Play()
  286.  
  287. end
  288.  
  289.  
  290.  
  291. function gunUp()
  292. Tool.GripForward = Vector3.new(0,.981,-.196)
  293. Tool.GripRight = Vector3.new(1,0,0)
  294. Tool.GripUp = Vector3.new(0,.196,.981)
  295. end
  296.  
  297. function gunOut()
  298. Tool.GripForward = Vector3.new(0,1,0)
  299. Tool.GripRight = Vector3.new(1,0,0)
  300. Tool.GripUp = Vector3.new(0,0,1)
  301. end
  302.  
  303.  
  304. function onActivated()
  305. if not enabled then
  306. return
  307. end
  308.  
  309. enabled = false
  310.  
  311.  
  312. local character = Tool.Parent;
  313. local humanoid = character.Humanoid
  314. if humanoid == nil then
  315. print("Humanoid not found")
  316. return
  317. end
  318.  
  319. local targetPos = humanoid.TargetPoint
  320. local lookAt = (targetPos - character.Head.Position).unit
  321.  
  322. local reload = .2
  323.  
  324.  
  325. gunUp()
  326. fire(lookAt)
  327. wait(reload)
  328. gunOut()
  329. wait(reload)
  330.  
  331. enabled = true
  332.  
  333. end
  334.  
  335. function onEquipped()
  336. Tool.Handle.EquipSound:play()
  337. end
  338.  
  339. script.Parent.Activated:connect(onActivated)
  340. script.Parent.Equipped:connect(onEquipped)
  341.  
  342.  
  343. end))
  344. LocalScript4.Name = "BackGun"
  345. LocalScript4.Parent = Tool0
  346. table.insert(cors,sandbox(LocalScript4,function()
  347. --machokickface
  348.  
  349. guntype = 1
  350. weldmode = 2
  351.  
  352. model = nil
  353. distance = 0.85
  354. rotation = 55
  355.  
  356. y = 0
  357. x = 0
  358. -------------------------------------------------------------------------------------------------------------------------------------------------------------------
  359.  
  360. parts = {}
  361. local n = 1
  362. --Gun types
  363. function on(mouse)
  364. if model == nil then
  365. n = 1
  366. local m = Instance.new("Model")
  367. local all = script.Parent:GetChildren()
  368. for i = 1, #all do
  369. if all[i].className == "Part" then
  370. parts[n] = all[i].Transparency
  371. local brick = all[i]:clone()
  372. brick.Parent = m
  373. n = n +1
  374. end
  375. end
  376. wait()
  377. if model == nil then
  378. local weld = script:FindFirstChild("Weld2")
  379. if weld ~= nil then
  380. local new = weld:clone()
  381. new.Disabled = false
  382. new.Parent = m
  383. m.Name = script.Parent.Name
  384. m.Parent = script.Parent.Parent
  385. model = m
  386. local handle = model:FindFirstChild("Handle")
  387. if handle ~= nil then
  388. --------------------------------------------------------------------------------
  389. --------------------------------------------------------------------------------
  390. --------------------------------------------------------------------------------
  391. --------------------------------------------------------------------------------
  392. --------------------------------------------------------------------------------
  393. if guntype == 1 then
  394. local torso = model.Parent:FindFirstChild("Torso")
  395. if torso ~= nil then
  396. if weldmode == 1 then--barrel pointing upper-right
  397. local w = Instance.new("Weld")
  398. w.Part0 = torso
  399. w.Parent = w.Part0
  400. w.Part1 = handle
  401. w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2), 0)
  402. elseif weldmode == 2 then--barrel pointing upper-left
  403. local w = Instance.new("Weld")
  404. w.Part0 = torso
  405. w.Parent = w.Part0
  406. w.Part1 = handle
  407. w.C1 = CFrame.new(distance, 0.25 +y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), (math.pi / 2 ) *-1, 0)
  408. elseif weldmode == 3 then--barrel pointing upside-right
  409. local w = Instance.new("Weld")
  410. w.Part0 = torso
  411. w.Parent = w.Part0
  412. w.Part1 = handle
  413. w.C1 = CFrame.new(distance *-1, -0.1+y, 0.2 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2), -1.5)
  414. elseif weldmode == 4 then--barrel pointing upside-left
  415. local w = Instance.new("Weld")
  416. w.Part0 = torso
  417. w.Parent = w.Part0
  418. w.Part1 = handle
  419. w.C1 = CFrame.new(distance, 0.25+y, -0.75 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), (math.pi / 2 +rotation) *-1.1, 1)
  420. end
  421. end
  422. --------------------------------------------------------------------------------
  423. --------------------------------------------------------------------------------
  424. --------------------------------------------------------------------------------
  425. --------------------------------------------------------------------------------
  426. --------------------------------------------------------------------------------
  427. elseif guntype == 2 then--BullPup
  428. local torso = model.Parent:FindFirstChild("Torso")
  429. if torso ~= nil then
  430. if weldmode == 1 then--barrel pointing upper-right
  431. local w = Instance.new("Weld")
  432. w.Part0 = torso
  433. w.Parent = w.Part0
  434. w.Part1 = handle
  435. w.C1 = CFrame.new(distance *-1, 0.25+y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2, 0)
  436. elseif weldmode == 2 then--barrel pointing upper-left
  437. local w = Instance.new("Weld")
  438. w.Part0 = torso
  439. w.Parent = w.Part0
  440. w.Part1 = handle
  441. w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation *-1), math.pi / 2 *-1, 0)
  442. elseif weldmode == 3 then--barrel pointing upside-right
  443. local w = Instance.new("Weld")
  444. w.Part0 = torso
  445. w.Parent = w.Part0
  446. w.Part1 = handle
  447. w.C1 = CFrame.new(distance *-1, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2, 0)
  448. elseif weldmode == 4 then--barrel pointing upside-left
  449. local w = Instance.new("Weld")
  450. w.Part0 = torso
  451. w.Parent = w.Part0
  452. w.Part1 = handle
  453. w.C1 = CFrame.new(distance, 0.25 +y, -0.5 +x *-1) * CFrame.fromEulerAnglesXYZ(math.rad(rotation), math.pi / 2 *-1, 0)
  454. end
  455. end
  456. --------------------------------------------------------------------------------
  457. --------------------------------------------------------------------------------
  458. --------------------------------------------------------------------------------
  459. --------------------------------------------------------------------------------
  460. --------------------------------------------------------------------------------
  461. elseif guntype == 3 then--pistol
  462. local lleg = model.Parent:FindFirstChild("Left Leg")
  463. local rleg = model.Parent:FindFirstChild("Right Leg")
  464. if lleg ~= nil and rleg ~= nil then
  465. if weldmode == 1 then--pistol on right leg
  466. local w = Instance.new("Weld")
  467. w.Part0 = rleg
  468. w.Parent = w.Part0
  469. w.Part1 = handle
  470. w.C1 = CFrame.new(distance *-1, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
  471. elseif weldmode == 2 then--pistol on left leg
  472. local w = Instance.new("Weld")
  473. w.Part0 = lleg
  474. w.Parent = w.Part0
  475. w.Part1 = handle
  476. w.C1 = CFrame.new(distance, 0 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi / 2, 0, 0)
  477. elseif weldmode == 3 then--knife in pant's back, gangsta like
  478. local w = Instance.new("Weld")
  479. w.Part0 = torso
  480. w.Parent = w.Part0
  481. w.Part1 = handle
  482. w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2, 0)
  483. elseif weldmode == 4 then--knife in pant's front, gangsta like
  484. local w = Instance.new("Weld")
  485. w.Part0 = torso
  486. w.Parent = w.Part0
  487. w.Part1 = handle
  488. w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi / 2 , math.pi / 2 *-1, 0)
  489. end
  490. end
  491. --------------------------------------------------------------------------------
  492. --------------------------------------------------------------------------------
  493. --------------------------------------------------------------------------------
  494. --------------------------------------------------------------------------------
  495. --------------------------------------------------------------------------------
  496. elseif guntype == 4 then--knife
  497. local lleg = model.Parent:FindFirstChild("Left Leg")
  498. local rleg = model.Parent:FindFirstChild("Right Leg")
  499. local torso = model.Parent:FindFirstChild("Torso")
  500. if lleg ~= nil and rleg ~= nil and torso ~= nil then
  501. if weldmode == 1 then--pistol on right leg
  502. local w = Instance.new("Weld")
  503. w.Part0 = rleg
  504. w.Parent = w.Part0
  505. w.Part1 = handle
  506. w.C1 = CFrame.new(distance *-1, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
  507. elseif weldmode == 2 then--pistol on left leg
  508. local w = Instance.new("Weld")
  509. w.Part0 = lleg
  510. w.Parent = w.Part0
  511. w.Part1 = handle
  512. w.C1 = CFrame.new(distance, 0.15 +y, -0.25 +x *-1) * CFrame.fromEulerAnglesXYZ(math.pi, 0, 0)
  513. elseif weldmode == 3 then--knife in pant's back, gangsta like
  514. local w = Instance.new("Weld")
  515. w.Part0 = torso
  516. w.Parent = w.Part0
  517. w.Part1 = handle
  518. w.C1 = CFrame.new(distance *-1, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2, 0)
  519. elseif weldmode == 4 then--knife in pant's front, gangsta like
  520. local w = Instance.new("Weld")
  521. w.Part0 = torso
  522. w.Parent = w.Part0
  523. w.Part1 = handle
  524. w.C1 = CFrame.new(distance, 0 +y, 0.25 +x) * CFrame.fromEulerAnglesXYZ(math.pi , math.pi / 2 *-1, 0)
  525. end
  526. end
  527. end
  528. end
  529. end
  530. end
  531. end
  532. --------------------------------------------------------------------------------
  533. --------------------------------------------------------------------------------
  534. --------------------------------------------------------------------------------
  535. --------------------------------------------------------------------------------
  536. --------------------------------------------------------------------------------
  537. if model ~= nil then
  538. n = 1
  539. local all = model:GetChildren()
  540. for i = 1, #all do
  541. if all[i].className == "Part" then
  542. all[i].Transparency = 1
  543. end
  544. end
  545. end
  546. end
  547. --check
  548. function off(mouse)
  549. if model ~= nil then
  550. n = 1
  551. local all = model:GetChildren()
  552. for i = 1, #all do
  553. if all[i].className == "Part" then
  554. all[i].Transparency = parts[n]
  555. local Do = true
  556. if Do then
  557. Do = false--false check
  558. n = n +1
  559. end
  560. end
  561. end
  562. end
  563. end
  564. --done!
  565. script.Parent.Equipped:connect(on)
  566. script.Parent.Unequipped:connect(off)
  567.  
  568. end))
  569. LocalScript5.Name = "WeldScript"
  570. LocalScript5.Parent = LocalScript4
  571. LocalScript5.Disabled = true
  572. table.insert(cors,sandbox(LocalScript5,function()
  573. function Weld(x,y)
  574. local W = Instance.new("Weld")
  575. W.Part0 = x
  576. W.Part1 = y
  577. local CJ = CFrame.new(x.Position)
  578. local C0 = x.CFrame:inverse()*CJ
  579. local C1 = y.CFrame:inverse()*CJ
  580. W.C0 = C0
  581. W.C1 = C1
  582. W.Parent = x
  583. end
  584.  
  585. function Get(A)
  586. if A.className == "Part" then
  587. Weld(script.Parent.Handle, A)
  588. A.Anchored = false
  589. else
  590. local C = A:GetChildren()
  591. for i=1, #C do
  592. Get(C[i])
  593. end
  594. end
  595. end
  596. local yes = true
  597. if yes then
  598. yes = false
  599. Get(script.Parent)
  600. end
  601. function onDied()
  602. script.Parent.Parent = nil
  603. end
  604. h = script.Parent.Parent:FindFirstChild("Humanoid")
  605. if h ~= nil then
  606. h.Died:connect(onDied)
  607. end
  608.  
  609. end))
  610. LocalScript6.Name = "Local Gui"
  611. LocalScript6.Parent = Tool0
  612. table.insert(cors,sandbox(LocalScript6,function()
  613. local Tool = script.Parent;
  614.  
  615. enabled = true
  616. function onButton1Down(mouse)
  617. if not enabled then
  618. return
  619. end
  620.  
  621. enabled = false
  622. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  623.  
  624. wait(.2)
  625. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  626. enabled = true
  627.  
  628. end
  629.  
  630. function onEquippedLocal(mouse)
  631.  
  632. if mouse == nil then
  633. print("Mouse not found")
  634. return
  635. end
  636.  
  637. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  638. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  639. end
  640.  
  641.  
  642. Tool.Equipped:connect(onEquippedLocal)
  643.  
  644.  
  645. end))
  646. Part7.Name = "Handle"
  647. Part7.Parent = Tool0
  648. Part7.BrickColor = BrickColor.new("Bright green")
  649. Part7.Rotation = Vector3.new(-90, 90, 0)
  650. Part7.Size = Vector3.new(1, 2.4000001, 1)
  651. Part7.CFrame = CFrame.new(-97.5, 0.5, 131.800003, 0, 0, 1, -1, 0, 0, 0, -1, 0)
  652. Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
  653. Part7.Position = Vector3.new(-97.5, 0.5, 131.800003)
  654. Part7.Orientation = Vector3.new(0, 90, -90)
  655. Part7.Color = Color3.new(0.294118, 0.592157, 0.294118)
  656. Sound8.Name = "EquipSound"
  657. Sound8.Parent = Part7
  658. Sound8.SoundId = "http://www.roblox.com/asset/?id=10756118"
  659. Sound9.Name = "PewPew"
  660. Sound9.Parent = Part7
  661. Sound9.SoundId = "http://www.roblox.com/asset/?id=13775480"
  662. Sound9.Volume = 1
  663. SpecialMesh10.Parent = Part7
  664. SpecialMesh10.MeshId = "http://www.roblox.com/asset/?id=22963494"
  665. SpecialMesh10.Scale = Vector3.new(0.649999976, 1, 0.649999976)
  666. SpecialMesh10.TextureId = "http://www.roblox.com/asset/?id=46095939"
  667. SpecialMesh10.VertexColor = Vector3.new(9, 1, 0)
  668. SpecialMesh10.MeshType = Enum.MeshType.FileMesh
  669. SpecialMesh10.Scale = Vector3.new(0.649999976, 1, 0.649999976)
  670. Script11.Name = "WeldArm"
  671. Script11.Parent = Tool0
  672. table.insert(cors,sandbox(Script11,function()
  673. Tool = script.Parent;
  674. local arms = nil
  675. local torso = nil
  676. local welds = {}
  677.  
  678. function Equip(mouse)
  679. wait(0.01)
  680. arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
  681. torso = Tool.Parent:FindFirstChild("Torso")
  682. if arms ~= nil and torso ~= nil then
  683. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  684. if sh ~= nil then
  685. local yes = true
  686. if yes then
  687. yes = false
  688. sh[1].Part1 = nil
  689. sh[2].Part1 = nil
  690. local weld1 = Instance.new("Weld")
  691. weld1.Part0 = torso
  692. weld1.Parent = torso
  693. weld1.Part1 = arms[1]
  694. weld1.C1 = CFrame.new(-0.249, 1.35, 0.6) * CFrame.fromEulerAnglesXYZ(math.rad(290), 0, math.rad(-90))
  695. welds[1] = weld1
  696. local weld2 = Instance.new("Weld")
  697. weld2.Part0 = torso
  698. weld2.Parent = torso
  699. weld2.Part1 = arms[2]
  700. weld2.C1 = CFrame.new(-1, -0.2, 0.35) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(-15), 0)
  701. welds[2] = weld2
  702. end
  703. else
  704. print("sh")
  705. end
  706. else
  707. print("arms")
  708. end
  709. end
  710.  
  711. function Unequip(mouse)
  712. if arms ~= nil and torso ~= nil then
  713. local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
  714. if sh ~= nil then
  715. local yes = true
  716. if yes then
  717. yes = false
  718. sh[1].Part1 = arms[1]
  719. sh[2].Part1 = arms[2]
  720. welds[1].Parent = nil
  721. welds[2].Parent = nil
  722. end
  723. else
  724. print("sh")
  725. end
  726. else
  727. print("arms")
  728. end
  729. end
  730. Tool.Equipped:connect(Equip)
  731. Tool.Unequipped:connect(Unequip)
  732.  
  733. end))
  734. Tool12.Name = "Sleep Dart Gun"
  735. Tool12.Parent = mas
  736. Tool12.TextureId = "http://www.roblox.com/asset/?id=21514222"
  737. Tool12.GripForward = Vector3.new(0.999861121, -0.0166643523, 0)
  738. Tool12.GripPos = Vector3.new(-1, -0.699999988, 1.5)
  739. Tool12.GripRight = Vector3.new(-0, 0, 1)
  740. Tool12.GripUp = Vector3.new(0.0166643523, 0.999861121, 0)
  741. Part13.Name = "Handle"
  742. Part13.Parent = Tool12
  743. Part13.BrickColor = BrickColor.new("Black")
  744. Part13.Reflectance = 0.10000000149012
  745. Part13.Rotation = Vector3.new(180, 0, -0.00999999978)
  746. Part13.Locked = true
  747. Part13.FormFactor = Enum.FormFactor.Symmetric
  748. Part13.Size = Vector3.new(1, 1, 1)
  749. Part13.CFrame = CFrame.new(-99.5000687, 0.50007242, 128.5, 1, 0.00014496794, -7.4505806e-08, 0.000144967926, -0.999999881, -3.41060513e-13, -5.96046448e-08, -1.09139364e-11, -0.999999881)
  750. Part13.BottomSurface = Enum.SurfaceType.Smooth
  751. Part13.TopSurface = Enum.SurfaceType.Smooth
  752. Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
  753. Part13.Position = Vector3.new(-99.5000687, 0.50007242, 128.5)
  754. Part13.Orientation = Vector3.new(0, -180, 179.98999)
  755. Part13.Color = Color3.new(0.105882, 0.164706, 0.207843)
  756. SpecialMesh14.Parent = Part13
  757. SpecialMesh14.MeshId = "http://www.roblox.com/asset/?id=12221651"
  758. SpecialMesh14.Scale = Vector3.new(0.75, 0.460000008, 0.400000006)
  759. SpecialMesh14.MeshType = Enum.MeshType.FileMesh
  760. SpecialMesh14.Scale = Vector3.new(0.75, 0.460000008, 0.400000006)
  761. Script15.Parent = Part13
  762. table.insert(cors,sandbox(Script15,function()
  763. while true do
  764. script.Parent.Locked=true
  765. wait()
  766. end
  767.  
  768. end))
  769. LocalScript16.Name = "Local Gui"
  770. LocalScript16.Parent = Tool12
  771. table.insert(cors,sandbox(LocalScript16,function()
  772. local Tool = script.Parent;
  773.  
  774. enabled = true
  775. function onButton1Down(mouse)
  776. if not enabled then
  777. return
  778. end
  779.  
  780. enabled = false
  781. mouse.Icon = "rbxasset://textures\\GunWaitCursor.png"
  782.  
  783. wait(2)
  784. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  785. enabled = true
  786.  
  787. end
  788.  
  789. function onEquippedLocal(mouse)
  790.  
  791. if mouse == nil then
  792. print("Mouse not found")
  793. return
  794. end
  795.  
  796. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  797. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  798. end
  799.  
  800.  
  801.  
  802. Tool.Equipped:connect(onEquippedLocal)
  803.  
  804. end))
  805. Script17.Name = "Slingshot"
  806. Script17.Parent = Tool12
  807. table.insert(cors,sandbox(Script17,function()
  808. Tool = script.Parent
  809. VELOCITY = 150 -- constant
  810.  
  811. local Pellet = Instance.new("Part")
  812. Pellet.Name = "Dart"
  813. Pellet.Locked = true
  814. Pellet.BackSurface = 0
  815. Pellet.BottomSurface = 0
  816. Pellet.FrontSurface = 0
  817. Pellet.LeftSurface = 0
  818. Pellet.RightSurface = 0
  819. Pellet.TopSurface = 0
  820. Pellet.Reflectance = 0
  821. Pellet.BrickColor = BrickColor.new(21)
  822. Pellet.Shape = "Block"
  823. Pellet.Size = Vector3.new(1,1.2,1)
  824. script.Parent.PelletScript:clone().Parent = Pellet
  825.  
  826. local mesh = Instance.new("SpecialMesh")
  827. mesh = Tool.Dart:clone()
  828. mesh.Scale = Vector3.new(0.2, 0.2 ,0.1)
  829. mesh.Parent = Pellet
  830.  
  831. function fire(mouse_pos, offset)
  832.  
  833.  
  834.  
  835. -- find player's head pos
  836.  
  837. local vCharacter = Tool.Parent
  838. local vPlayer = game.Players:playerFromCharacter(vCharacter)
  839.  
  840. local head = vCharacter:findFirstChild("Head")
  841. if head == nil then return end
  842.  
  843. local dir = mouse_pos - head.Position
  844. dir = computeDirection(dir)
  845. local pelletCF = CFrame.new(head.Position, head.Position + dir)
  846. local missile = Pellet:clone()
  847. missile.CFrame = pelletCF * offset
  848.  
  849. local delta = mouse_pos - missile.CFrame.p
  850.  
  851. local dy = delta.y
  852.  
  853. local new_delta = Vector3.new(delta.x, 0, delta.z)
  854. delta = new_delta
  855.  
  856. local dx = delta.magnitude
  857. local unit_delta = delta.unit
  858.  
  859. -- acceleration due to gravity in RBX units
  860. local g = (1 * 20)
  861.  
  862. local theta = computeLaunchAngle( dx, dy, g)
  863.  
  864. local vy = math.sin(theta)
  865. local xz = math.cos(theta)
  866. local vx = unit_delta.x * xz
  867. local vz = unit_delta.z * xz
  868.  
  869. missile.Velocity = Vector3.new(vx,vy,vz) * VELOCITY * 1.3
  870.  
  871. missile.PelletScript.Disabled = false
  872.  
  873. local creator_tag = Instance.new("ObjectValue")
  874. creator_tag.Value = vPlayer
  875. creator_tag.Name = "creator"
  876. creator_tag.Parent = missile
  877.  
  878. missile.Parent = game.Workspace
  879.  
  880. end
  881.  
  882.  
  883. function computeLaunchAngle(dx,dy,grav)
  884. -- arcane
  885. -- http://en.wikipedia.org/wiki/Trajectory_of_a_projectile
  886.  
  887. local g = math.abs(grav)
  888. local inRoot = (VELOCITY*VELOCITY*VELOCITY*VELOCITY) - (g * ((g*dx*dx) + (2*dy*VELOCITY*VELOCITY)))
  889. if inRoot <= 0 then
  890. return .25 * math.pi
  891. end
  892. local root = math.sqrt(inRoot)
  893. local inATan1 = ((VELOCITY*VELOCITY) + root) / (g*dx)
  894.  
  895. local inATan2 = ((VELOCITY*VELOCITY) - root) / (g*dx)
  896. local answer1 = math.atan(inATan1)
  897. local answer2 = math.atan(inATan2)
  898. if answer1 < answer2 then return answer1 end
  899. return answer2
  900. end
  901.  
  902. function computeDirection(vec)
  903. local lenSquared = vec.magnitude * vec.magnitude
  904. local invSqrt = 1 / math.sqrt(lenSquared)
  905. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  906. end
  907.  
  908.  
  909.  
  910.  
  911. Tool.Enabled = true
  912. function onActivated()
  913.  
  914. if not Tool.Enabled then
  915. return
  916. end
  917.  
  918. Tool.Enabled = false
  919.  
  920. local character = Tool.Parent;
  921. local humanoid = character.Humanoid
  922. if humanoid == nil then
  923. print("Humanoid not found")
  924. return
  925. end
  926.  
  927. local targetPos = humanoid.TargetPoint
  928.  
  929. for i=1,1 do
  930. for j=1,1 do
  931. fire(targetPos, CFrame.new(i,j,-5))
  932. end
  933. end
  934.  
  935. wait(2)
  936.  
  937. Tool.Enabled = true
  938. end
  939.  
  940. script.Parent.Activated:connect(onActivated)
  941.  
  942.  
  943.  
  944. end))
  945. Script18.Name = "PelletScript"
  946. Script18.Parent = Tool12
  947. Script18.Disabled = true
  948. table.insert(cors,sandbox(Script18,function()
  949. pellet = script.Parent
  950. damage = 0
  951. welded = false
  952. function stick(hit)
  953. welded = true
  954. -- joint myself to the thing i hit
  955. local weld = Instance.new("Weld")
  956.  
  957. weld.Part0 = pellet
  958. weld.Part1 = hit
  959.  
  960. local HitPos = pellet.Position + (pellet.CFrame.lookVector * .5)
  961.  
  962. local CJ = CFrame.new(HitPos)
  963. local C0 = pellet.CFrame:inverse() *CJ
  964. local C1 = hit.CFrame:inverse() * CJ
  965.  
  966. weld.C0 = C0
  967. weld.C1 = C1
  968.  
  969. weld.Parent = pellet
  970. end
  971.  
  972. function onTouched(hit)
  973. if welded == false and hit.Parent:findFirstChild("Arrow") == nil then stick(hit) end
  974. humanoid = hit.Parent:findFirstChild("Humanoid")
  975. if humanoid~=nil then
  976. tagHumanoid(humanoid)
  977. humanoid.Health = humanoid.Health - damage
  978. humanoid.PlatformStand=true
  979. wait(2)
  980. untagHumanoid(humanoid)
  981. else
  982. wait(2)
  983. connection:disconnect()
  984. end
  985. end
  986.  
  987. function tagHumanoid(humanoid)
  988. -- todo: make tag expire
  989. local tag = pellet:findFirstChild("creator")
  990. if tag ~= nil then
  991. local new_tag = tag:clone()
  992. new_tag.Parent = humanoid
  993.  
  994. end
  995. end
  996.  
  997.  
  998. function untagHumanoid(humanoid)
  999. if humanoid ~= nil then
  1000. local tag = humanoid:findFirstChild("creator")
  1001. if tag ~= nil then
  1002.  
  1003. tag.Parent = nil
  1004. end
  1005. end
  1006. end
  1007.  
  1008. connection = pellet.Touched:connect(onTouched)
  1009.  
  1010. wait(2)
  1011. if welded then wait(2) end
  1012. pellet.Parent = nil
  1013. end))
  1014. SpecialMesh19.Name = "Dart"
  1015. SpecialMesh19.Parent = Tool12
  1016. SpecialMesh19.MeshId = "http://www.roblox.com/asset/?id=2251534"
  1017. SpecialMesh19.Scale = Vector3.new(0.200000003, 0.200000003, 0.100000001)
  1018. SpecialMesh19.MeshType = Enum.MeshType.FileMesh
  1019. SpecialMesh19.Scale = Vector3.new(0.200000003, 0.200000003, 0.100000001)
  1020. for i,v in pairs(mas:GetChildren()) do
  1021. v.Parent = game:GetService("Players").LocalPlayer.Backpack
  1022. pcall(function() v:MakeJoints() end)
  1023. end
  1024. mas:Destroy()
  1025. for i,v in pairs(cors) do
  1026. spawn(function()
  1027. pcall(v)
  1028. end)
  1029. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement