kingsans

turrent and guard

Feb 27th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.29 KB | None | 0 0
  1. local Name="iliketrainsornot"
  2. local char=workspace[Name]
  3. color2=BrickColor:Black()
  4. color=BrickColor.new("Dark stone grey")
  5.  
  6.  
  7. player = game.Players[Name]
  8.  
  9. if script.Parent.className~="HopperBin" then
  10. pcall(function() game.Players[Name]["Drop Turret."]:remove() end)
  11. pcall(function() char.Handle:remove() end)
  12. Gun = Instance.new("HopperBin")
  13. Gun.Parent = game.Players[Name].Backpack
  14. Gun.Name="Drop Turret"
  15. Board=Instance.new("Part")
  16. Board.Size=Vector3.new(3,1,3)
  17. Board.BrickColor=color
  18. Board.Reflectance=0
  19. Board.Name="Handle"
  20. Board.Transparency=0
  21. Board.CanCollide=true
  22. Board.Parent=char
  23. Board.TopSurface="Weld"
  24. Mesh=Instance.new("BlockMesh")
  25. Mesh.Parent=Board
  26. Mesh.Scale=Vector3.new(.34*1.5,.34/2,.34*1.5)
  27. w = Instance.new("Weld")
  28. w.Parent = Board
  29. w.Part0 = w.Parent
  30. w.Part1 = char.Torso
  31. w.C0 = CFrame.new(0,0.5,0)*CFrame.Angles(math.rad(90),0,math.rad(90))
  32. Tor=Instance.new("Part")
  33. Tor.Size=Vector3.new(1,1,1)
  34. Tor.BrickColor=color2
  35. Tor.Reflectance=0
  36. Tor.Anchored=false
  37. Tor.Transparency=0
  38. Tor.CanCollide=true
  39. Tor.Parent=Board
  40. Tor.TopSurface="Weld"
  41. Mesh2=Instance.new("CylinderMesh")
  42. Mesh2.Parent=Tor
  43. Mesh2.Scale=Vector3.new(0.4,0.15,0.4)
  44. w2 = Instance.new("Weld")
  45. w2.Parent = Board
  46. w2.Part0 = w2.Parent
  47. w2.Part1 = Tor
  48. w2.C0 = CFrame.new(0.25,-0.05,0.35)*CFrame.Angles(0,0,math.rad(180))
  49. Tor=Instance.new("Part")
  50. Tor.Size=Vector3.new(1,1,1)
  51. Tor.BrickColor=color2
  52. Tor.Reflectance=0
  53. Tor.Anchored=false
  54. Tor.Transparency=0
  55. Tor.CanCollide=true
  56. Tor.Parent=Board
  57. Tor.TopSurface="Weld"
  58. Mesh2=Instance.new("CylinderMesh")
  59. Mesh2.Parent=Tor
  60. Mesh2.Scale=Vector3.new(0.4,0.15,0.4)
  61. w2 = Instance.new("Weld")
  62. w2.Parent = Board
  63. w2.Part0 = w2.Parent
  64. w2.Part1 = Tor
  65. w2.C0 = CFrame.new(0.25,-0.05,-0.35)*CFrame.Angles(0,0,math.rad(180))
  66. Tor=Instance.new("Part")
  67. Tor.Size=Vector3.new(1,1,1)
  68. Tor.BrickColor=color2
  69. Tor.Reflectance=0
  70. Tor.Anchored=false
  71. Tor.Transparency=0
  72. Tor.CanCollide=true
  73. Tor.Parent=Board
  74. Tor.TopSurface="Weld"
  75. Mesh2=Instance.new("BlockMesh")
  76. Mesh2.Parent=Tor
  77. Mesh2.Scale=Vector3.new(0.1,0.15,0.9)
  78. w2 = Instance.new("Weld")
  79. w2.Parent = Board
  80. w2.Part0 = w2.Parent
  81. w2.Part1 = Tor
  82. w2.C0 = CFrame.new(-0.2,-0.075,0)*CFrame.Angles(0,0,math.rad(180))
  83. Tor=Instance.new("Part")
  84. Tor.Size=Vector3.new(1,1,1)
  85. Tor.BrickColor=color2
  86. Tor.Reflectance=0
  87. Tor.Anchored=false
  88. Tor.Transparency=0
  89. Tor.CanCollide=true
  90. Tor.Parent=Board
  91. Tor.TopSurface="Weld"
  92. Mesh2=Instance.new("BlockMesh")
  93. Mesh2.Parent=Tor
  94. Mesh2.Scale=Vector3.new(0.1,0.15,0.9)
  95. w2 = Instance.new("Weld")
  96. w2.Parent = Board
  97. w2.Part0 = w2.Parent
  98. w2.Part1 = Tor
  99. w2.C0 = CFrame.new(-0.375,-0.075,0)*CFrame.Angles(0,0,math.rad(180))
  100. Tor4=Instance.new("Part")
  101. Tor4.Size=Vector3.new(1,1,1)
  102. Tor4.BrickColor=color
  103. Tor4.Reflectance=0
  104. Tor4.Anchored=false
  105. Tor4.Transparency=0
  106. Tor4.CanCollide=true
  107. Tor4.Parent=Board
  108. Tor4.TopSurface="Weld"
  109. Mesh2=Instance.new("CylinderMesh")
  110. Mesh2.Parent=Tor4
  111. Mesh2.Scale=Vector3.new(0.2,0.15,0.2)
  112. w2 = Instance.new("Weld")
  113. w2.Parent = Tor4
  114. w2.Part0 = Board
  115. w2.Part1 = w2.Parent
  116. w2.C0 = CFrame.new(0.25,-0.07,0.35)*CFrame.Angles(0,0,math.rad(180))
  117. Tor=Instance.new("Part")
  118. Tor.Size=Vector3.new(1,1,1)
  119. Tor.BrickColor=color
  120. Tor.Reflectance=0
  121. Tor.Anchored=false
  122. Tor.Transparency=0
  123. Tor.CanCollide=true
  124. Tor.Parent=Board
  125. Tor.TopSurface="Weld"
  126. Mesh2=Instance.new("CylinderMesh")
  127. Mesh2.Parent=Tor
  128. Mesh2.Scale=Vector3.new(0.2,0.15,0.2)
  129. w2 = Instance.new("Weld")
  130. w2.Parent = Board
  131. w2.Part0 = w2.Parent
  132. w2.Part1 = Tor
  133. w2.C0 = CFrame.new(0.25,-0.07,-0.35)*CFrame.Angles(0,0,math.rad(180))
  134. script.Parent=Gun
  135. script.Name="Not A QuickScript"
  136. end
  137. model=script.Parent
  138.  
  139. function Make(Mesh)
  140. for i=1,28 do
  141. Mesh.Scale=Mesh.Scale+Vector3.new(.015,.0326,.015)
  142. wait()
  143. end
  144. local model=Board
  145. model.Name="Setting up."
  146. for i=0,270,90 do
  147. Tor=Instance.new("Part")
  148. Tor.Size=Vector3.new(1,1,1)
  149. Tor.BrickColor=color2
  150. Tor.Reflectance=0
  151. Tor.Anchored=false
  152. Tor.Transparency=0
  153. Tor.CanCollide=true
  154. Tor.Parent=model
  155. Tor.TopSurface="Weld"
  156. Mesh=Instance.new("CylinderMesh")
  157. Mesh.Parent=Tor
  158. Mesh.Scale=Vector3.new(1.2,0.7,1.2)
  159. w = Instance.new("Weld")
  160. w.Parent = Board
  161. w.Part0 = w.Parent
  162. w.Part1 = Tor
  163. w.C0 = CFrame.new(0,-0.25,0)*CFrame.Angles(0,math.rad(i),math.rad(90))
  164. coroutine.resume(coroutine.create(function()
  165. local w=w
  166. for i=1,60 do
  167. wait()
  168. w.C0=w.C0*CFrame.new(0,0.03,0)
  169. end
  170. end))
  171.  
  172. Tor=Instance.new("Part")
  173. Tor.Size=Vector3.new(1,1,1)
  174. Tor.BrickColor=color2
  175. Tor.Reflectance=0
  176. Tor.Anchored=false
  177. Tor.Transparency=0
  178. Tor.CanCollide=true
  179. Tor.Parent=model
  180. Tor.TopSurface="Weld"
  181. Mesh=Instance.new("CylinderMesh")
  182. Mesh.Parent=Tor
  183. Mesh.Scale=Vector3.new(1,0.9,1)
  184. w = Instance.new("Weld")
  185. w.Parent = Board
  186. w.Part0 = w.Parent
  187. w.Part1 = Tor
  188. w.C0 = CFrame.new(0,-0.25,0)*CFrame.Angles(0,math.rad(i),math.rad(90))
  189. coroutine.resume(coroutine.create(function()
  190. local w=w
  191. for i=1,80 do
  192. wait()
  193. w.C0=w.C0*CFrame.new(0,0.03,0)
  194. end
  195. end))
  196.  
  197. Tor=Instance.new("Part")
  198. Tor.Size=Vector3.new(1,1,1)
  199. Tor.BrickColor=color2
  200. Tor.Reflectance=0
  201. Tor.Anchored=false
  202. Tor.Transparency=0
  203. Tor.CanCollide=true
  204. Tor.Parent=model
  205. Tor.TopSurface="Weld"
  206. Mesh=Instance.new("SpecialMesh")
  207. Mesh.MeshType="Sphere"
  208. Mesh.Parent=Tor
  209. Mesh.Scale=Vector3.new(0.9,0.85,0.9)
  210. w = Instance.new("Weld")
  211. w.Parent = Board
  212. w.Part0 = w.Parent
  213. w.Part1 = Tor
  214. w.C0 = CFrame.new(0,-0.25,0)*CFrame.Angles(0,math.rad(i),math.rad(90))
  215. coroutine.resume(coroutine.create(function()
  216. local w=w
  217. for i=1,100 do
  218. wait()
  219. w.C0=w.C0*CFrame.new(0,0.03,0)
  220. end
  221. end))
  222. end
  223.  
  224. wait(2)
  225.  
  226. Tor=Instance.new("Part")
  227. Tor.Size=Vector3.new(1,1,1)
  228. Tor.BrickColor=color2
  229. Tor.Reflectance=0
  230. Tor.Anchored=false
  231. Tor.Transparency=0
  232. Tor.CanCollide=true
  233. Tor.Parent=model
  234. Tor.TopSurface="Weld"
  235. Mesh=Instance.new("CylinderMesh")
  236. Mesh.Parent=Tor
  237. Mesh.Scale=Vector3.new(1.7,0.8,1.7)
  238. w = Instance.new("Weld")
  239. w.Parent = Board
  240. w.Part0 = w.Parent
  241. w.Part1 = Tor
  242. w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  243. coroutine.resume(coroutine.create(function()
  244. local w=w
  245. for i=1,30 do
  246. wait()
  247. w.C0=w.C0*CFrame.new(0,0.03,0)
  248. end
  249. end))
  250.  
  251. Tor=Instance.new("Part")
  252. Tor.Size=Vector3.new(1,1,1)
  253. Tor.BrickColor=color2
  254. Tor.Reflectance=0
  255. Tor.Anchored=false
  256. Tor.Transparency=0
  257. Tor.CanCollide=true
  258. Tor.Parent=model
  259. Tor.TopSurface="Weld"
  260. Mesh=Instance.new("CylinderMesh")
  261. Mesh.Parent=Tor
  262. Mesh.Scale=Vector3.new(1.4,0.8,1.4)
  263. w = Instance.new("Weld")
  264. w.Parent = Board
  265. w.Part0 = w.Parent
  266. w.Part1 = Tor
  267. w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  268. coroutine.resume(coroutine.create(function()
  269. local w=w
  270. for i=1,45 do
  271. wait()
  272. w.C0=w.C0*CFrame.new(0,0.03,0)
  273. end
  274. end))
  275.  
  276. Tor=Instance.new("Part")
  277. Tor.Size=Vector3.new(1,1,1)
  278. Tor.BrickColor=color2
  279. Tor.Reflectance=0
  280. Tor.Anchored=false
  281. Tor.Transparency=0
  282. Tor.CanCollide=true
  283. Tor.Parent=model
  284. Tor.TopSurface="Weld"
  285. Mesh=Instance.new("CylinderMesh")
  286. Mesh.Parent=Tor
  287. Mesh.Scale=Vector3.new(1.1,0.8,1.1)
  288. w = Instance.new("Weld")
  289. w.Parent = Board
  290. w.Part0 = w.Parent
  291. w.Part1 = Tor
  292. w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  293. coroutine.resume(coroutine.create(function()
  294. local w=w
  295. for i=1,60 do
  296. wait()
  297. w.C0=w.C0*CFrame.new(0,0.03,0)
  298. end
  299. end))
  300.  
  301. Tor=Instance.new("Part")
  302. Tor.Size=Vector3.new(1,1,1)
  303. Tor.BrickColor=color
  304. Tor.Reflectance=0
  305. Tor.Name="Torso"
  306. Tor.Anchored=false
  307. Tor.Transparency=0
  308. Tor.CanCollide=true
  309. Tor.Parent=model
  310. Mesh=Instance.new("CylinderMesh")
  311. Mesh.Parent=Tor
  312. Mesh.Scale=Vector3.new(0.7,0.6,0.7)
  313. w = Instance.new("Weld")
  314. w.Parent = Board
  315. w.Part0 = w.Parent
  316. w.Part1 = Tor
  317. w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,0,0)
  318. coroutine.resume(coroutine.create(function()
  319. local w=w
  320. for i=1,75 do
  321. wait()
  322. w.C0=w.C0*CFrame.new(0,0.03,0)
  323. end
  324. end))
  325.  
  326. Tora=Instance.new("Part")
  327. Tora.Size=Vector3.new(1,1,1)
  328. Tora.BrickColor=BrickColor:Blue()
  329. Tora.Reflectance=0.5
  330. Tora.Name="Head"
  331. Tora.Anchored=false
  332. Tora.Transparency=0
  333. Tora.CanCollide=true
  334. Tora.Parent=model
  335. Mesh=Instance.new("BlockMesh")
  336. Mesh.Parent=Tora
  337. Mesh.Scale=Vector3.new(0.9,0.7,0.9)
  338. Tora.CFrame=Tor.CFrame*CFrame.new(0,0.5,0)
  339. w = Instance.new("Weld")
  340. w.Parent = Tora
  341. w.Part0 = w.Parent
  342. w.Part1 = Tor
  343. coroutine.resume(coroutine.create(function()
  344. local w=w
  345. for i=1,70 do
  346. wait()
  347. w.C0=w.C0*CFrame.new(0,-i/3000,0)
  348. end
  349. end))
  350. Instance.new("Humanoid").Parent=model
  351. wait(2.5)
  352. for i=0,270,90 do
  353. Tor=Instance.new("Part")
  354. Tor.Size=Vector3.new(1,1,1)
  355. Tor.BrickColor=color2
  356. Tor.Reflectance=0
  357. Tor.Anchored=false
  358. Tor.Transparency=0
  359. Tor.CanCollide=true
  360. Tor.Parent=model
  361. Tor.TopSurface="Weld"
  362. Mesh=Instance.new("CylinderMesh")
  363. Mesh.Parent=Tor
  364. Mesh.Scale=Vector3.new(0.2,0.3,0.2)
  365. w = Instance.new("Weld")
  366. w.Parent = Tora
  367. w.Part0 = w.Parent
  368. w.Part1 = Tor
  369. w.C0 = CFrame.new(0,0,0)*CFrame.Angles(0,math.rad(i),math.rad(90))
  370. coroutine.resume(coroutine.create(function()
  371. local w=w
  372. for i=1,60 do
  373. wait()
  374. w.C0=w.C0*CFrame.new(0,0.01,0)
  375. end
  376. end))
  377.  
  378. coroutine.resume(coroutine.create(function()
  379. for i=1,math.huge,0.2 do
  380. Tora.Weld.C0=Tora.Weld.C0*CFrame.Angles(0,math.rad(2),0)
  381. wait()
  382. end
  383. end))
  384. end
  385. local Tar=nil
  386. Pet=Tora
  387.  
  388. function Fire(v)
  389. v.Anchored=true
  390. local Laz=Instance.new("Part")
  391. Laz.Anchored=true
  392. Laz.BrickColor=BrickColor:Black()
  393. Laz.Reflectance=0.2
  394. Laz.TopSurface="Smooth"
  395. Laz.BottomSurface="Smooth"
  396. Laz.CanCollide=false
  397. Laz.CFrame=CFrame.new((Pet.Position+v.Position)/2,v.Position)
  398. Laz.Parent=v
  399. Laz.Size=Vector3.new(1,1,2)
  400. Laz.Transparency=0
  401. local Me=Instance.new("BlockMesh")
  402. Me.Parent=Laz
  403. for i=1,25 do
  404. Me.Scale = Vector3.new(i/55,i/55,(Pet.Position - v.Position).magnitude/2)
  405. Laz.CFrame=CFrame.new((Pet.Position+v.Position)/2,v.Position)
  406. wait()
  407. end
  408. ex=Instance.new("Explosion")
  409. ex.Position=v.Position
  410. ex.BlastPressure=0
  411. ex.Hit:connect(function(v)
  412. if v.Parent.Name~=Name and v.Parent.Parent.Name~=Name and v.Name~="Base" and v.Parent~=model then
  413. v:BreakJoints()
  414. v.Velocity=(v.Position-ex.Position).unit*900
  415. end
  416. end)
  417. ex.BlastRadius=1
  418. ex.Parent=v
  419. wait()
  420. for i=1,3 do
  421. wait(0.15)
  422. Laz.Transparency=Laz.Transparency+0.3
  423. end
  424. Laz:remove()
  425. v.Anchored=false
  426. end
  427.  
  428. function Find()
  429. Tor=Instance.new("Part")
  430. Tor.Size=Vector3.new(1,1,1)
  431. Tor.BrickColor=BrickColor:White()
  432. Tor.Reflectance=0.2
  433. Tor.Anchored=false
  434. Tor.Transparency=0.92
  435. Tor.CanCollide=false
  436. Tor.Parent=model
  437. Tor.TopSurface="Weld"
  438. Star=Tor
  439. Mesh=Instance.new("SpecialMesh")
  440. Mesh.MeshType="Sphere"
  441. Mesh.Parent=Tor
  442. Mesh.Scale=Vector3.new(1,0.8,1)
  443. w = Instance.new("Weld")
  444. w.Parent = Tor
  445. w.Part0 = w.Parent
  446. w.Part1 = Tora
  447. Delay(1.2,function()
  448. for i=1,24*10 do
  449. wait()
  450. Mesh.Scale=Mesh.Scale+Vector3.new(0.1,0.08,0.1)
  451. Dist=Mesh.Scale.x/2
  452. model.Name="Range:"..math.ceil(Mesh.Scale.x/2)
  453. end
  454. end)
  455.  
  456. Dist=Mesh.Scale.x/2
  457.  
  458. function Sar(p)
  459. for _,ve in pairs(game.Players:GetChildren()) do
  460. if ve.className=="Player" and ve.Character and ve.Character:FindFirstChild("Torso")~=nil and ve.Name~=Name and (ve.Character.Torso.Position-Tora.Position).magnitude<Dist and ve.Character.Humanoid.Health>-1 then --Magnitude,my dear watson.
  461. Tar=ve.Character.Torso
  462. end
  463. end
  464. end
  465.  
  466. model.Name="Primed."
  467. wait(1)
  468. while true do
  469. wait(0.2)
  470. if Tar==nil then
  471. pcall(function() Sar(workspace) end)
  472. else
  473. Pet.BrickColor=BrickColor:Red()
  474. Fire(Tar)
  475. wait(0.5)
  476. pcall(function() Tar=nil end)
  477. Pet.BrickColor=BrickColor:Blue()
  478. end
  479. end
  480. end
  481.  
  482. Loop=coroutine.create(function() Find() end)
  483. coroutine.resume(Loop)
  484. char.Humanoid.Died:connect(function()
  485. pcall(function() coroutine.yield(Loop) end)
  486. end)
  487. model.Humanoid.Died:connect(function()
  488. model.Name="AntiDeath Triggered."
  489. wait()
  490. local t = char.Torso
  491. for i=1,50,0.5 do
  492. wait()
  493. x = (16 + i) * math.sin(i) + t.Position.x
  494. y = t.Position.y
  495. z = (16 + i)* math.cos (i) + t.Position.z
  496. brick = Instance.new("Explosion")
  497. brick.BlastPressure=0
  498. brick.Hit:connect(function(hit)
  499. if hit.Parent.Name~=Name and hit.Name~="Base" and hit.Name~="Handle" and hit.Parent.Parent.Name~=Name then
  500. hit:BreakJoints()
  501. hit.Anchored=false
  502. hit.Velocity=(hit.Position-char.Torso.Position).unit*320
  503. end
  504. end)
  505. brick.BlastRadius = 20
  506. brick.Parent = workspace
  507. brick.Position = Vector3.new(x,y,z)
  508. end
  509. end)
  510. end
  511.  
  512.  
  513. de=true
  514. con=model.Selected:connect(function(BLAH)
  515. if de==true then
  516. de=false
  517. con:disconnect()
  518. w:remove()
  519. Board.CFrame=char.Torso.CFrame*CFrame.new(0,0,-4)*CFrame.new(0,-2.5,0)*CFrame.Angles(0,0,math.rad(180))
  520. Tor4.BrickColor=BrickColor:Red()
  521. for i=1,9 do
  522. Tor4.Weld.C0=Tor4.Weld.C0*CFrame.new(0,-0.002,0)
  523. wait(0.1)
  524. end
  525. Board.CFrame=Board.CFrame*CFrame.Angles(0,0,math.rad(180))
  526. Make(Mesh)
  527. model.Name=" "
  528. end
  529. end)
Add Comment
Please, Sign In to add comment