Advertisement
raywill

raywill teapot turret

Apr 15th, 2019
2,099
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.58 KB | None | 0 0
  1.  
  2. local runDummyScript = function(f,scri)
  3. local oldenv = getfenv(f)
  4. local newenv = setmetatable({}, {
  5. __index = function(_, k)
  6. if k:lower() == 'script' then
  7. return scri
  8. else
  9. return oldenv[k]
  10. end
  11. end
  12. })
  13. setfenv(f, newenv)
  14. ypcall(function() f() end)
  15. end
  16. cors = {}
  17. mas = Instance.new("Model",game:GetService("Lighting"))
  18. mas.Name = "CompiledModel"
  19. o1 = Instance.new("Tool")
  20. o2 = Instance.new("Part")
  21. o3 = Instance.new("SpecialMesh")
  22. o4 = Instance.new("Sound")
  23. o5 = Instance.new("LocalScript")
  24. o6 = Instance.new("Script")
  25. o7 = Instance.new("HopperBin")
  26. o8 = Instance.new("LocalScript")
  27. o9 = Instance.new("HopperBin")
  28. o10 = Instance.new("Sound")
  29. o11 = Instance.new("LocalScript")
  30. o12 = Instance.new("HopperBin")
  31. o13 = Instance.new("Script")
  32. o14 = Instance.new("Sound")
  33. o1.Name = "GravityHammer"
  34. o1.Parent = mas
  35. o1.TextureId = "http://www.roblox.com/asset/?id=1256305"
  36. o1.GripForward = Vector3.new(-1, -0, -0)
  37. o1.GripPos = Vector3.new(0, 0, -3.25)
  38. o1.GripRight = Vector3.new(0, 1, 0)
  39. o1.GripUp = Vector3.new(0, 0, 1)
  40. o2.Name = "Handle"
  41. o2.Parent = o1
  42. o2.BrickColor = BrickColor.new("Dark stone grey")
  43. o2.Reflectance = 0.40000000596046
  44. o2.Position = Vector3.new(-7.53602743, 4.99960041, -31.5799809)
  45. o2.Rotation = Vector3.new(-90, 0.0500000007, 180)
  46. o2.FormFactor = Enum.FormFactor.Plate
  47. o2.Size = Vector3.new(1, 0.800000012, 10)
  48. o2.CFrame = CFrame.new(-7.53602743, 4.99960041, -31.5799809, -0.999999642, -7.56997451e-07, 0.000796274224, 0.000796274282, 9.09494702e-13, 0.999999702, -7.5623251e-07, 0.99999994, 6.00266503e-10)
  49. o2.BottomSurface = Enum.SurfaceType.Smooth
  50. o2.TopSurface = Enum.SurfaceType.Smooth
  51. o2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  52. o2.Position = Vector3.new(-7.53602743, 4.99960041, -31.5799809)
  53. o2.Orientation = Vector3.new(-89.9599991, 90, 90)
  54. o2.Color = Color3.new(0.388235, 0.372549, 0.384314)
  55. o3.Parent = o2
  56. o3.MeshId = "http://www.roblox.com/asset/?id=1256290"
  57. o3.Scale = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  58. o3.TextureId = "http://www.roblox.com/asset/?id=1256283"
  59. o3.MeshType = Enum.MeshType.FileMesh
  60. o3.Scale = Vector3.new(0.0500000007, 0.0500000007, 0.0500000007)
  61. o4.Parent = o2
  62. o4.SoundId = "http://www.roblox.com/asset/?id=1255794"
  63. o4.Volume = 1
  64. o5.Name = "Local Gui"
  65. o5.Parent = o1
  66. table.insert(cors,coroutine.create(function()
  67. wait()
  68. runDummyScript(function()
  69.  
  70. end,o5)
  71. end))
  72. o6.Name = "SwordScript"
  73. o6.Parent = o1
  74. table.insert(cors,coroutine.create(function()
  75. wait()
  76. runDummyScript(function()
  77. -------- OMG HAX
  78.  
  79.  
  80.  
  81. r = game:service("RunService")
  82.  
  83.  
  84.  
  85.  
  86.  
  87. local damage = 5
  88.  
  89.  
  90.  
  91.  
  92.  
  93. local slash_damage = 10
  94.  
  95. local lunge_damage = 30
  96.  
  97.  
  98.  
  99. sword = script.Parent.Handle
  100.  
  101. Tool = script.Parent
  102.  
  103.  
  104.  
  105. SlashSound = sword.Sound
  106.  
  107.  
  108.  
  109. function blow(hit)
  110.  
  111. Grip = Tool.Parent["Right Arm"].RightGrip:clone()
  112.  
  113. humanoid = hit.Parent:findFirstChild("Humanoid")
  114.  
  115. if(humanoid ~= nil and humanoid.Parent.Name == Tool.Parent.Name) then --don't hit yourself
  116.  
  117. return
  118.  
  119. end
  120.  
  121.  
  122.  
  123. --if(Tool:findFirstChild("toolAnim") == nil) then return end
  124.  
  125. if(humanoid ~= nil) then --if it's a person, damage him and stop
  126.  
  127. propel(hit)
  128.  
  129. print(humanoid.Parent.Name)
  130.  
  131. humanoid.Health = humanoid.Health - 49
  132.  
  133. else
  134.  
  135. explode(hit) --explode only if it doesn't hit a person (ie, blowing holes through walls)
  136.  
  137. end
  138.  
  139.  
  140.  
  141. end
  142.  
  143.  
  144.  
  145. function propel(part)
  146.  
  147. if(part.Anchored) then return end --if it isn't anchored, make it flyyy
  148.  
  149. direction = (part.Position - Tool.Parent.Torso.Position).unit
  150.  
  151. direction = direction + Vector3.new(0,1,0)
  152.  
  153. direction = direction * 200
  154.  
  155. part.Velocity = part.Velocity + direction
  156.  
  157. end
  158.  
  159.  
  160.  
  161. debounce = true
  162.  
  163. function explode(part)
  164.  
  165. if not debounce then return end
  166.  
  167.  
  168.  
  169. debounce = false
  170.  
  171. direction = (part.Position - Tool.Parent.Torso.Position).unit
  172.  
  173. pos = direction * 12 + Tool.Parent.Torso.Position
  174.  
  175. explosion = Instance.new("Explosion")
  176.  
  177. explosion.BlastRadius = 4
  178.  
  179. explosion.BlastPressure = 1
  180.  
  181. explosion.Position = pos
  182.  
  183. explosion.Parent = game.Workspace
  184.  
  185. explosion.Hit:connect(function(part, distance) propel(part) end)
  186.  
  187. wait(.1)
  188.  
  189. Grip:clone().Parent = Tool.Parent["Right Arm"]
  190.  
  191. debounce = true
  192.  
  193. end
  194.  
  195.  
  196.  
  197. function attack()
  198.  
  199. SlashSound:play()
  200.  
  201. local anim = Instance.new("StringValue")
  202.  
  203. anim.Name = "toolanim"
  204.  
  205. anim.Value = "Slash"
  206.  
  207. anim.Parent = Tool
  208.  
  209. end
  210.  
  211.  
  212.  
  213. function lunge()
  214.  
  215. attack()
  216.  
  217. force = Instance.new("BodyPosition")
  218.  
  219. force.maxForce = Vector3.new(1e+005,1e+004,1e+005)
  220.  
  221. dir = Tool.Parent.Humanoid.targetPoint
  222.  
  223. if((dir - sword.Position).magnitude > 15) then return end
  224.  
  225. force.position = dir
  226.  
  227. force.Parent = sword
  228.  
  229. wait(.25)
  230.  
  231. force.Parent = nil
  232.  
  233. end
  234.  
  235.  
  236.  
  237. function swordUp()
  238.  
  239. Tool.GripForward = Vector3.new(-1,0,0)
  240.  
  241. Tool.GripRight = Vector3.new(0,1,0)
  242.  
  243. Tool.GripUp = Vector3.new(0,0,1)
  244.  
  245. end
  246.  
  247.  
  248.  
  249. function swordOut()
  250.  
  251. Tool.GripForward = Vector3.new(0,0,1)
  252.  
  253. Tool.GripRight = Vector3.new(0,-1,0)
  254.  
  255. Tool.GripUp = Vector3.new(-1,0,0)
  256.  
  257. end
  258.  
  259.  
  260.  
  261. function swordAcross()
  262.  
  263. -- parry
  264.  
  265. end
  266.  
  267.  
  268.  
  269.  
  270.  
  271. Tool.Enabled = true
  272.  
  273. local last_attack = 0
  274.  
  275. function onActivated()
  276.  
  277.  
  278.  
  279. if not Tool.Enabled then
  280.  
  281. return
  282.  
  283. end
  284.  
  285.  
  286.  
  287. Tool.Enabled = false
  288.  
  289.  
  290.  
  291. local character = Tool.Parent;
  292.  
  293. local humanoid = character.Humanoid
  294.  
  295. if humanoid == nil then
  296.  
  297. print("Humanoid not found")
  298.  
  299. return
  300.  
  301. end
  302.  
  303.  
  304.  
  305. t = r.Stepped:wait()
  306.  
  307. connection = sword.Touched:connect(blow)
  308.  
  309. lunge()
  310.  
  311.  
  312.  
  313. wait(.4)
  314.  
  315. connection:disconnect()
  316.  
  317. last_attack = t
  318.  
  319. Tool.Enabled = true
  320.  
  321.  
  322.  
  323.  
  324.  
  325. end
  326.  
  327. script.Parent.Activated:connect(onActivated)
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. end,o6)
  335. end))
  336. o7.Name = "Fire Shield"
  337. o7.Parent = mas
  338. o8.Parent = o7
  339. table.insert(cors,coroutine.create(function()
  340. wait()
  341. runDummyScript(function()
  342. --clockwork
  343.  
  344. --Fix implemented by Luckymaxer
  345.  
  346. HopperBin = script.Parent
  347.  
  348. Debris = game:GetService("Debris")
  349.  
  350. function GetX(t)
  351. return 41 * math.cos(t) - 18 * math.sin(t) - 83 * math.cos(2 * t) - 11 * math.cos(3 * t) + 27 * math.sin(3 * t)
  352. end
  353.  
  354. function GetY(t)
  355. return 36 * math.cos(t) + 27 * math.sin(t) - 113 * math.cos(2 * t) + 30 * math.sin(2 * t) + 11 * math.cos(3 * t) - 27 * math.sin(3 * t)
  356. end
  357.  
  358. function GetZ(t)
  359. return 45 * math.sin(t) - 30 * math.cos(2 * t) + 113 * math.sin(2 * t) - 11 * math.cos(3 * t) + 27 * math.sin(3 * t)
  360. end
  361.  
  362. Template = Instance.new("Explosion")
  363. Template.BlastRadius = 3
  364. Template.BlastPressure = 0
  365. Template.ExplosionType = Enum.ExplosionType.NoCraters
  366.  
  367. Spaw = false
  368.  
  369. function TagHumanoid(humanoid, player)
  370. local Creator_Tag = Instance.new("ObjectValue")
  371. Creator_Tag.Name = "creator"
  372. Creator_Tag.Value = player
  373. Debris:AddItem(Creator_Tag, 2)
  374. Creator_Tag.Parent = humanoid
  375. end
  376.  
  377. function UntagHumanoid(humanoid)
  378. for i, v in pairs(humanoid:GetChildren()) do
  379. if v:IsA("ObjectValue") and v.Name == "creator" then
  380. v:Destroy()
  381. end
  382. end
  383. end
  384.  
  385. function FindCharacterAncestor(Parent)
  386. if Parent and Parent ~= game:GetService("Workspace") then
  387. local humanoid = Parent:FindFirstChild("Humanoid")
  388. if humanoid then
  389. return Parent, humanoid
  390. else
  391. return FindCharacterAncestor(Parent.Parent)
  392. end
  393. end
  394. return nil
  395. end
  396.  
  397. function ExplosionHit(Explosion)
  398. Explosion.Hit:connect(function(Hit)
  399. if Hit and Hit.Parent then
  400. local character, humanoid = FindCharacterAncestor(Hit)
  401. if character and character ~= Character and humanoid and humanoid.Health > 0 then
  402. UntagHumanoid(humanoid)
  403. TagHumanoid(humanoid, Player)
  404. Hit:BreakJoints()
  405. end
  406. end
  407. end)
  408. end
  409.  
  410. function Button1Down()
  411. Spaw = not Spaw
  412. i = 0
  413. if Spaw then
  414. while Spaw do
  415. i = (i + 0.15)
  416. local Explosion = Template:Clone()
  417. Explosion.Position = Torso.Position + Vector3.new(GetX(i) / 5, GetY(i) / 5, GetZ(i) / 5)
  418. ExplosionHit(Explosion)
  419. Explosion.Parent = game:GetService("Workspace")
  420. Explosion = Template:Clone()
  421. Explosion.Position = Torso.Position - Vector3.new(GetX(i) / 5, GetY(i) / 5, GetZ(i) / 5)
  422. ExplosionHit(Explosion)
  423. Explosion.Parent = game:GetService("Workspace")
  424. wait(0.025)
  425. end
  426. end
  427. end
  428.  
  429. function Selected(Mouse)
  430. Backpack = HopperBin.Parent
  431. Player = Backpack.Parent
  432. Character = Player.Character
  433. Humanoid = Character:FindFirstChild("Humanoid")
  434. Torso = Character:FindFirstChild("Torso")
  435. if not Player or not Character or not Humanoid or Humanoid.Health == 0 or not Torso then
  436. return
  437. end
  438. Mouse.Button1Down:connect(function()
  439. Button1Down()
  440. end)
  441. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  442. end
  443.  
  444. HopperBin.Selected:connect(Selected)
  445. end,o8)
  446. end))
  447. o9.Name = "Katon Goukakyou No Jutsu"
  448. o9.Parent = mas
  449. o10.Parent = o9
  450. o10.SoundId = "http://www.roblox.com/asset/?id=1079802"
  451. o10.Volume = 0.20000000298023
  452. o11.Parent = o9
  453. table.insert(cors,coroutine.create(function()
  454. wait()
  455. runDummyScript(function()
  456. --clockwork
  457.  
  458. --Fix implemented by Luckymaxer
  459.  
  460. HopperBin = script.Parent
  461.  
  462. Sound = HopperBin:WaitForChild("Sound")
  463.  
  464. Debris = game:GetService("Debris")
  465.  
  466. function TagHumanoid(humanoid, player)
  467. local Creator_Tag = Instance.new("ObjectValue")
  468. Creator_Tag.Name = "creator"
  469. Creator_Tag.Value = player
  470. Debris:AddItem(Creator_Tag, 2)
  471. Creator_Tag.Parent = humanoid
  472. end
  473.  
  474. function UntagHumanoid(humanoid)
  475. for i, v in pairs(humanoid:GetChildren()) do
  476. if v:IsA("ObjectValue") and v.Name == "creator" then
  477. v:Destroy()
  478. end
  479. end
  480. end
  481.  
  482. function FindCharacterAncestor(Parent)
  483. if Parent and Parent ~= game:GetService("Workspace") then
  484. local humanoid = Parent:FindFirstChild("Humanoid")
  485. if humanoid then
  486. return Parent, humanoid
  487. else
  488. return FindCharacterAncestor(Parent.Parent)
  489. end
  490. end
  491. return nil
  492. end
  493.  
  494. function ExplosionHit(Explosion)
  495. Explosion.Hit:connect(function(Hit)
  496. if Hit and Hit.Parent then
  497. local character, humanoid = FindCharacterAncestor(Hit)
  498. if character and character ~= Character and humanoid and humanoid.Health > 0 then
  499. UntagHumanoid(humanoid)
  500. TagHumanoid(humanoid, Player)
  501. Hit:BreakJoints()
  502. end
  503. end
  504. end)
  505. end
  506.  
  507. function Explode(Position)
  508. local Explosion = Instance.new("Explosion")
  509. Explosion.BlastRadius = 10
  510. Explosion.BlastPressure = 0
  511. Explosion.ExplosionType = Enum.ExplosionType.NoCraters
  512. Explosion.Position = Position
  513. ExplosionHit(Explosion)
  514. Explosion.Parent = game:GetService("Workspace")
  515. end
  516.  
  517. function Button1Down(Mouse)
  518. local StartPos = Head.Position
  519. local Delta = Mouse.Hit.p - StartPos
  520. local Unit = Delta.unit
  521. Sound:Play()
  522. for i = 0, 75 do
  523. Explode(StartPos + Unit * 20 + i * Unit * i / 25)
  524. wait(0.05)
  525. end
  526. end
  527.  
  528. function Selected(Mouse)
  529. Backpack = HopperBin.Parent
  530. Player = Backpack.Parent
  531. Character = Player.Character
  532. Humanoid = Character:FindFirstChild("Humanoid")
  533. Head = Character:FindFirstChild("Head")
  534. if not Player or not Character or not Humanoid or Humanoid.Health == 0 or not Head then
  535. return
  536. end
  537. Mouse.Button1Down:connect(function()
  538. Button1Down(Mouse)
  539. end)
  540. Mouse.Icon = "rbxasset://textures\\GunCursor.png"
  541. end
  542.  
  543. HopperBin.Selected:connect(Selected)
  544. end,o11)
  545. end))
  546. o12.Name = "SpinFire"
  547. o12.Parent = mas
  548. o13.Parent = o12
  549. table.insert(cors,coroutine.create(function()
  550. wait()
  551. runDummyScript(function()
  552. --clockwork
  553.  
  554.  
  555.  
  556. local bin = script.Parent
  557.  
  558. sfx = bin.Sound
  559.  
  560.  
  561.  
  562. function explode(pos)
  563.  
  564. local lol = Instance.new("Explosion")
  565.  
  566. lol.BlastRadius = 2
  567.  
  568. lol.BlastPressure = 1000000
  569.  
  570. lol.Position = pos
  571.  
  572. lol.Parent = game.Workspace
  573.  
  574. end
  575.  
  576.  
  577.  
  578. function onButton1Down(mouse)
  579.  
  580. local player = game.Players.LocalPlayer
  581.  
  582. if player == nil then return end
  583.  
  584. print("trigger")
  585.  
  586. -- find the best cf
  587.  
  588.  
  589.  
  590. sfx:play()
  591.  
  592. look = CFrame.new(player.Character.Head.Position,mouse.Hit.p)
  593.  
  594. for i=0,75 do
  595.  
  596. x = math.sin(i / 3) * 8 * (75 - i) / 75
  597.  
  598. y = math.cos(i / 3) * 8 * (75 - i) / 75
  599.  
  600. helix = look * CFrame.new(x,y,-i)
  601.  
  602.  
  603.  
  604. explode(helix.p)
  605.  
  606.  
  607.  
  608. x = -math.sin(i / 3) * 8 * (75 - i) / 75
  609.  
  610. y = -math.cos(i / 3) * 8 * (75 - i) / 75
  611.  
  612. helix = look * CFrame.new(x,y,-i)
  613.  
  614.  
  615.  
  616. explode(helix.p)
  617.  
  618. wait(.02)
  619.  
  620. end
  621.  
  622. sfx:pause()
  623.  
  624. end
  625.  
  626.  
  627.  
  628. function onSelected(mouse)
  629.  
  630. print("select")
  631.  
  632. mouse.Icon = "rbxasset://textures\\GunCursor.png"
  633.  
  634. mouse.Button1Down:connect(function() onButton1Down(mouse) end)
  635.  
  636. end
  637.  
  638.  
  639.  
  640. bin.Selected:connect(onSelected)
  641.  
  642.  
  643. end,o13)
  644. end))
  645. o14.Parent = o12
  646. o14.SoundId = "http://www.roblox.com/asset/?id=12222095"
  647. o14.Volume = 0.60000002384186
  648. mas.Parent = workspace
  649. mas:MakeJoints()
  650. local mas1 = mas:GetChildren()
  651. for i=1,#mas1 do
  652. mas1[i].Parent = game:GetService("Players").LocalPlayer.Backpack
  653. ypcall(function() mas1[i]:MakeJoints() end)
  654. end
  655. mas:Destroy()
  656. for i=1,#cors do
  657. coroutine.resume(cors[i])
  658. end
  659. --Forcefield
  660. local f = Instance.new("ForceField")
  661. f.Parent = game.Players.localPlayer.Character
  662. --Teapot
  663. hat = Instance.new'Accessory'
  664. hat.Name = 'GoldTeapot'
  665. hat.AttachmentForward = Vector3.new(0,0,-1)
  666. hat.AttachmentPos = Vector3.new(0, 0.300000012, 0)
  667. hat.AttachmentUp = Vector3.new(0, 1, 0)
  668. hat.AttachmentRight = Vector3.new(1, 0, 0)
  669. handle = Instance.new('Part', hat)
  670. handle.Name = 'Handle'
  671. handle.Locked = true
  672. handle.CanCollide = true
  673. handle.Transparency = 0
  674. handle.BrickColor = BrickColor.new'Medium stone grey'
  675. handle.Size = Vector3.new(2, 0.800000012, 2)
  676. mesh = Instance.new('SpecialMesh', handle)
  677. mesh.MeshId = 'http://www.roblox.com/asset/?id=1594167'
  678. mesh.Scale = Vector3.new(1, 1, 1)
  679. mesh.VertexColor = Vector3.new(1, 1, 1)
  680. mesh.TextureId = 'http://www.roblox.com/asset/?id=1594166'
  681. att = Instance.new('Attachment', handle)
  682. att.Name = 'HatAt'
  683. att.Position = Vector3.new(8.65838956e-09, 0.400000095, -0.000272244215)
  684. att.Axis = Vector3.new(1, -7.87137555e-09, 0)
  685. att.SecondaryAxis = Vector3.new(7.87137555e-09, 1, 4.1444221e-16)
  686. hat.Parent = game:GetService'Players'.LocalPlayer.Character
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement