Advertisement
Duelmaster12345

Untitled

Jul 13th, 2015
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.21 KB | None | 0 0
  1. --when you see YOURDRAGONNAME that means type your dragon name and when you see YOURNAMEHERE that mean you have to put your name--
  2. MainColor = "Bright blue"
  3.  
  4. Name = "the"
  5.  
  6.  
  7.  
  8. Plrs = game:GetService("Players")
  9.  
  10.  
  11.  
  12. me = Plrs.zombegat
  13. char = me.Character
  14.  
  15. Modelname = "xDragon"
  16.  
  17. PetName = "xDragon"
  18.  
  19. Toolname = "Dragon"
  20.  
  21. Surfaces = {"FrontSurface", "BackSurface", "TopSurface", "BottomSurface", "LeftSurface", "RightSurface"}
  22.  
  23. necko = CFrame.new(0, 1, 0, -1, -0, -0, 0, 0, 1, 0, 1, 0)
  24.  
  25. selected = false
  26.  
  27. Hurt = false
  28.  
  29. Deb = true
  30.  
  31. Able = true
  32.  
  33. Prop = {Damage = 30}
  34.  
  35.  
  36.  
  37. ToolIcon = ""
  38.  
  39. MouseIc = ""
  40.  
  41. MouseDo = ""
  42.  
  43.  
  44.  
  45. Add = {
  46.  
  47. Sphere = function(P)
  48.  
  49. local m = Instance.new("SpecialMesh",P)
  50.  
  51. m.MeshType = "Sphere"
  52.  
  53. return m
  54.  
  55. end,
  56.  
  57. BF = function(P)
  58.  
  59. local bf = Instance.new("BodyForce",P)
  60.  
  61. bf.force = Vector3.new(0, P:GetMass()*187, 0)
  62.  
  63. return bf
  64.  
  65. end,
  66.  
  67. BP = function(P)
  68.  
  69. local bp = Instance.new("BodyPosition",P)
  70.  
  71. bp.maxForce = Vector3.new(math.huge, 0, math.huge)
  72.  
  73. bp.P = 14000
  74.  
  75. return bp
  76.  
  77. end,
  78.  
  79. BG = function(P)
  80.  
  81. local bg = Instance.new("BodyGyro",P)
  82.  
  83. bg.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
  84.  
  85. bg.P = 14000
  86.  
  87. return bg
  88.  
  89. end,
  90.  
  91. Mesh = function(P, ID, x, y, z)
  92.  
  93. local m = Instance.new("SpecialMesh")
  94.  
  95. m.MeshId = ID
  96.  
  97. m.Scale = Vector3.new(x, y, z)
  98.  
  99. m.Parent = P
  100.  
  101. return m
  102.  
  103. end,
  104.  
  105. Sound = function(P, ID, vol, pitch)
  106.  
  107. local s = Instance.new("Sound")
  108.  
  109. s.SoundId = ID
  110.  
  111. s.Volume = vol
  112.  
  113. s.Pitch = pitch
  114.  
  115. s.Parent = P
  116.  
  117. return s
  118.  
  119. end
  120.  
  121. }
  122.  
  123.  
  124.  
  125. function find(tab, arg)
  126.  
  127. local ah = nil
  128.  
  129. for i,v in pairs(tab) do
  130.  
  131. if v == arg then
  132.  
  133. ah = v
  134.  
  135. end
  136.  
  137. end
  138.  
  139. return ah
  140.  
  141. end
  142.  
  143.  
  144.  
  145. function getAllParts(from)
  146.  
  147. local t = {}
  148.  
  149. function getParts(where)
  150.  
  151. for i, v in pairs(where:children()) do
  152.  
  153. if v:IsA("BasePart") then
  154.  
  155. if v.Parent ~= char and v.Parent.Parent ~= char then
  156.  
  157. table.insert(t, v)
  158.  
  159. end
  160.  
  161. end
  162.  
  163. getParts(v)
  164.  
  165. end
  166.  
  167. end
  168.  
  169. getParts(workspace)
  170.  
  171. return t
  172.  
  173. end
  174.  
  175.  
  176.  
  177. function RayCast(pos1, pos2, maxDist, forward)
  178.  
  179. local list = getAllParts(workspace)
  180.  
  181. local pos0 = pos1
  182.  
  183. for dist = 1, maxDist, forward do
  184.  
  185. pos0 = (CFrame.new(pos1, pos2) * CFrame.new(0, 0, -dist)).p
  186.  
  187. for _, v in pairs(list) do
  188.  
  189. local pos3 = v.CFrame:pointToObjectSpace(pos0)
  190.  
  191. local s = v.Size
  192.  
  193. if pos3.x > -(s.x/2) and pos3.x < (s.x/2) and pos3.y > -(s.y/2) and pos3.y < (s.y/2) and pos3.z > -(s.z/2) and pos3.x < (s.z/2) and v.CanCollide == true then
  194.  
  195. return pos0, v
  196.  
  197. end
  198.  
  199. end
  200.  
  201. end
  202.  
  203. return pos0, nil
  204.  
  205. end
  206.  
  207.  
  208.  
  209. function Part(Parent, Anchor, Collide, Tran, Ref, Color, X, Y, Z, Break)
  210.  
  211. local p = Instance.new("Part")
  212.  
  213. p.formFactor = "Custom"
  214.  
  215. p.Anchored = Anchor
  216.  
  217. p.CanCollide = Collide
  218.  
  219. p.Transparency = Tran
  220.  
  221. p.Reflectance = Ref
  222.  
  223. p.BrickColor = BrickColor.new(Color)
  224.  
  225. for _, Surf in pairs(Surfaces) do
  226.  
  227. p[Surf] = "Smooth"
  228.  
  229. end
  230.  
  231. p.Size = Vector3.new(X, Y, Z)
  232.  
  233. if Break then
  234.  
  235. p:BreakJoints()
  236.  
  237. else p:MakeJoints() end
  238.  
  239. p.Parent = Parent
  240.  
  241. return p
  242.  
  243. end
  244.  
  245.  
  246.  
  247. function Weld(p0, p1, x, y, z, a, b, c)
  248.  
  249. local w = Instance.new("Weld")
  250.  
  251. w.Parent = p0
  252.  
  253. w.Part0 = p0
  254.  
  255. w.Part1 = p1
  256.  
  257. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(a,b,c)
  258.  
  259. return w
  260.  
  261. end
  262.  
  263.  
  264.  
  265. function ComputePos(pos1, pos2)
  266.  
  267. local pos3 = Vector3.new(pos2.x, pos1.y, pos2.z)
  268.  
  269. return CFrame.new(pos1, pos3)
  270.  
  271. end
  272.  
  273.  
  274.  
  275. function getHumanoid(c)
  276.  
  277. local h = nil
  278.  
  279. for i,v in pairs(c:children()) do
  280.  
  281. if v:IsA("Humanoid") and c ~= char then
  282.  
  283. if v.Health > 0 then
  284.  
  285. h = v
  286.  
  287. end
  288.  
  289. end
  290.  
  291. end
  292.  
  293. return h
  294.  
  295. end
  296.  
  297.  
  298.  
  299. for i,v in pairs(char:children()) do
  300.  
  301. if v.Name == Modelname or v.Name == PetName then
  302.  
  303. v:remove()
  304.  
  305. end
  306.  
  307. end
  308.  
  309.  
  310.  
  311. torso = char.Torso
  312.  
  313. neck = torso.Neck
  314.  
  315. hum = char.Humanoid
  316.  
  317. Rarm = char["Right Arm"]
  318.  
  319. Larm = char["Left Arm"]
  320.  
  321. Rleg = char["Right Leg"]
  322.  
  323. Lleg = char["Left Leg"]
  324.  
  325.  
  326.  
  327. hc = Instance.new("Humanoid")
  328.  
  329. hc.Health = 0
  330.  
  331. hc.MaxHealth = 0
  332.  
  333.  
  334.  
  335. slash = Add.Sound(nil, "rbxasset://sounds//swordslash.wav", 0.9, 0.8)
  336.  
  337. hitsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2801263", 0.7, 0.6)
  338.  
  339. charge = Add.Sound(nil, "http://www.roblox.com/asset/?id=2101137", 0.8, 0.65)
  340.  
  341. boom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2691586", 0.8, 0.3)
  342.  
  343. smashsound = Add.Sound(nil, "http://www.roblox.com/asset/?id=2692806", 0.8, 0.35)
  344.  
  345. boomboom = Add.Sound(nil, "http://www.roblox.com/asset/?id=2760979", 1, 0.18)
  346.  
  347.  
  348.  
  349. function PlaySound(sound, pitch, vol)
  350.  
  351. local s = sound:clone()
  352.  
  353. if pitch ~= nil then
  354.  
  355. if tonumber(pitch) then
  356.  
  357. s.Pitch = tonumber(pitch)
  358.  
  359. end
  360.  
  361. end
  362.  
  363. if vol ~= nil then
  364.  
  365. if tonumber(vol) then
  366.  
  367. s.Volume = tonumber(vol)
  368.  
  369. end
  370.  
  371. end
  372.  
  373. s.Parent = torso
  374.  
  375. s.PlayOnRemove = true
  376.  
  377. coroutine.resume(coroutine.create(function()
  378.  
  379. wait()
  380.  
  381. s:remove()
  382.  
  383. end))
  384.  
  385. end
  386.  
  387.  
  388.  
  389. Mo = Instance.new("Model")
  390.  
  391. Mo.Name = Modelname
  392.  
  393.  
  394.  
  395. RABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  396.  
  397. LABrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  398.  
  399. RLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  400.  
  401. LLBrick = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  402.  
  403.  
  404.  
  405. RABW = Weld(torso, RABrick, -1.5, -0.5, 0, 0, 0, 0)
  406.  
  407. LABW = Weld(torso, LABrick, 1.5, -0.5, 0, 0, 0, 0)
  408.  
  409. RLBW = Weld(torso, RLBrick, -0.5, 1.2, 0, 0, 0, 0)
  410.  
  411. LLBW = Weld(torso, LLBrick, 0.5, 1.2, 0, 0, 0, 0)
  412.  
  413.  
  414.  
  415. RAW = Weld(RABrick, nil, 0, 0.5, 0, 0, 0, 0)
  416.  
  417. LAW = Weld(LABrick, nil, 0, 0.5, 0, 0, 0, 0)
  418.  
  419. RLW = Weld(RLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  420.  
  421. LLW = Weld(LLBrick, nil, 0, 0.8, 0, 0, 0, 0)
  422.  
  423.  
  424.  
  425. HB = Part(Mo, false, false, 1, 0, "White", 0.1, 0.1, 0.1, true)
  426.  
  427. HBW = Weld(Rarm, HB, 0, 1, 0, 0, 0, 0)
  428.  
  429. HW = Weld(HB, nil, 0, -1.3, 0, math.pi/2, 0, 0)
  430.  
  431.  
  432.  
  433. TH = Weld(torso, nil, -0.8, 0.4, -0.4, 0, math.pi/2, math.rad(80))
  434.  
  435.  
  436.  
  437. RAWStand, LAWStand, RLWStand, LLWStand, HWStand = nil
  438.  
  439.  
  440.  
  441. --handle = Part(Mo, false, false, 0, 0, GuitarColour, 0.6, 1.5, 1.5, true)
  442.  
  443.  
  444.  
  445. Pet = Instance.new("Model")
  446.  
  447. Pet.Name = PetName
  448.  
  449.  
  450.  
  451. petbody = Part(Pet, false, true, 0, 0, MainColor, 3, 2.6, 6, true)
  452.  
  453. Add.Sphere(petbody)
  454.  
  455. petbody.CFrame = torso.CFrame * CFrame.new(4, 0, 0)
  456.  
  457.  
  458.  
  459. bodytrim = Part(Pet, false, true, 0, 0, "Cool yellow", 2.7, 2.4, 5.4, true)
  460.  
  461. Add.Sphere(bodytrim)
  462.  
  463. Weld(petbody, bodytrim, 0, 0.25, 0, 0, 0, 0)
  464.  
  465.  
  466.  
  467. neckplace = Part(Pet, false, false, 0, 0, "Cool yellow", 0.1, 0.1, 0.1, true)
  468.  
  469. Weld(petbody, neckplace, 0, -0.2, 2.6, 0, 0, 0)
  470.  
  471.  
  472.  
  473. Mo.Parent = char
  474.  
  475. Pet.Parent = char
  476.  
  477. TH.Part1 = handle
  478.  
  479.  
  480.  
  481. if script.Parent.className ~= "HopperBin" then
  482.  
  483. h = Instance.new("HopperBin",me.Backpack)
  484.  
  485. h.Name = Toolname
  486.  
  487. h.TextureId = ToolIcon
  488.  
  489. script.Parent = h
  490.  
  491. end
  492.  
  493.  
  494.  
  495. bin = script.Parent
  496.  
  497.  
  498.  
  499. function detach(bool)
  500.  
  501. LLW.C0 = CFrame.new(0, 0, 0)
  502.  
  503. RLW.C0 = CFrame.new(0, 0, 0)
  504.  
  505. LAW.C0 = CFrame.new(0,0,0)
  506.  
  507. RAW.C0 = CFrame.new(0, 0, 0)
  508.  
  509. if bool then
  510.  
  511. LLW.Part1 = nil
  512.  
  513. RLW.Part1 = nil
  514.  
  515. RAW.Part1 = nil
  516.  
  517. LAW.Part1 = nil
  518.  
  519. end
  520.  
  521. end
  522.  
  523.  
  524.  
  525. function attach()
  526.  
  527. RAW.Part1 = Rarm
  528.  
  529. LAW.Part1 = Larm
  530.  
  531. RLW.Part1 = Rleg
  532.  
  533. LLW.Part1 = Lleg
  534.  
  535. end
  536.  
  537.  
  538.  
  539. function normal()
  540.  
  541. neck.C0 = NeckStand
  542.  
  543. RAW.C0 = RAWStand
  544.  
  545. LAW.C0 = LAWStand
  546.  
  547. RLW.C0 = RLWStand
  548.  
  549. LLW.C0 = LLWStand
  550.  
  551. RAW.C1 = CFrame.new(0, 0.5, 0)
  552.  
  553. LAW.C1 = CFrame.new(0, 0.5, 0)
  554.  
  555. RLW.C1 = CFrame.new(0, 0.8, 0)
  556.  
  557. LLW.C1 = CFrame.new(0, 0.8, 0)
  558.  
  559. HW.C0 = HWStand
  560.  
  561. end
  562.  
  563.  
  564.  
  565. function idleanim()
  566.  
  567. attach()
  568.  
  569. for i = 0, 1, 0.03 do
  570.  
  571. RAW.C0 = RAWStand * CFrame.Angles(0, 0, 0)
  572.  
  573. LAW.C0 = LAWStand * CFrame.Angles(0, 0, 0)
  574.  
  575. RLW.C0 = RLWStand * CFrame.Angles(0, 0, 0)
  576.  
  577. LLW.C0 = LLWStand * CFrame.Angles(0, 0, 0)
  578.  
  579. neck.C0 = NeckStand * CFrame.Angles(0, 0, 0)
  580.  
  581. if selected == false or torso.Velocity.magnitude > 2 or Able == false then break end
  582.  
  583. wait()
  584.  
  585. end
  586.  
  587. wait()
  588.  
  589. for i = 1, 0, -0.02 do
  590.  
  591. RAW.C0 = RAWStand * CFrame.Angles(0, 0, 0)
  592.  
  593. LAW.C0 = LAWStand * CFrame.Angles(0, 0, 0)
  594.  
  595. RLW.C0 = RLWStand * CFrame.Angles(0, 0, 0)
  596.  
  597. LLW.C0 = LLWStand * CFrame.Angles(0, 0, 0)
  598.  
  599. neck.C0 = NeckStand * CFrame.Angles(0, 0, 0)
  600.  
  601. if selected == false or torso.Velocity.magnitude > 2 or Able == false then break end
  602.  
  603. wait()
  604.  
  605. end
  606.  
  607. normal()
  608.  
  609. end
  610.  
  611.  
  612.  
  613. function runanim()
  614.  
  615. RLW.Part1 = nil
  616.  
  617. LLW.Part1 = nil
  618.  
  619. end
  620.  
  621.  
  622.  
  623. coroutine.resume(coroutine.create(function()
  624.  
  625. while true do
  626.  
  627. wait()
  628.  
  629. if selected and Able == true then
  630.  
  631. if torso.Velocity.magnitude < 2 then
  632.  
  633. --idleanim()
  634.  
  635. wait()
  636.  
  637. else
  638.  
  639. --runanim()
  640.  
  641. wait()
  642.  
  643. end
  644.  
  645. end
  646.  
  647. end
  648.  
  649. end))
  650.  
  651.  
  652.  
  653. function selectanim()
  654.  
  655. attach()
  656.  
  657. if RAWStand == nil then
  658.  
  659. RAWStand = RAW.C0
  660.  
  661. LAWStand = LAW.C0
  662.  
  663. RLWStand = RLW.C0
  664.  
  665. LLWStand = LLW.C0
  666.  
  667. HWStand = HW.C0
  668.  
  669. end
  670.  
  671. normal()
  672.  
  673. end
  674.  
  675.  
  676.  
  677. function deselanim()
  678.  
  679. neck.C0 = necko
  680.  
  681. detach(true)
  682.  
  683. end
  684.  
  685.  
  686.  
  687. function select(mouse)
  688.  
  689. selectanim()
  690.  
  691. selected = true
  692.  
  693. mouse.KeyDown:connect(function(key)
  694.  
  695. key = key:lower()
  696.  
  697. end)
  698.  
  699. mouse.Button1Down:connect(function()
  700.  
  701. end)
  702.  
  703. end
  704.  
  705.  
  706.  
  707. function deselect(mouse)
  708.  
  709. selected = false
  710.  
  711. deselanim()
  712.  
  713. end
  714.  
  715.  
  716.  
  717. bin.Selected:connect(select)
  718.  
  719. bin.Deselected:connect(deselect)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement