quoc9x

Untitled

Dec 3rd, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 47.09 KB | None | 0 0
  1. local p = game.Players.LocalPlayer
  2. local char = p.Character
  3. local mouse = p:GetMouse()
  4. local larm = char["Left Arm"]
  5. local rarm = char["Right Arm"]
  6. local lleg = char["Left Leg"]
  7. local rleg = char["Right Leg"]
  8. local hed = char.Head
  9. local torso = char.Torso
  10. local hum = char.Humanoid
  11. local cam = game.Workspace.CurrentCamera
  12. local root = char.HumanoidRootPart
  13. local deb = false
  14. local shot = 0
  15. local debris=game:service"Debris"
  16. local l = game:GetService("Lighting")
  17. local rs = game:GetService("RunService").RenderStepped
  18. ptz = {0.8, 0.85, 0.9, 0.95, 1, 1.05, 1.1}
  19. math.randomseed(os.time())
  20. for i,v in pairs(char:children()) do
  21. if v:IsA("Hat") then
  22. v:Destroy()
  23. end
  24. end
  25. for i,v in pairs (hed:GetChildren()) do
  26. if v:IsA("Sound") then
  27. v:Destroy()
  28. end
  29. end
  30.  
  31. CV="Crimson"
  32.  
  33. local txt = Instance.new("BillboardGui", char)
  34. txt.Adornee = char .Head
  35. txt.Name = "_status"
  36. txt.Size = UDim2.new(2, 0, 1.2, 0)
  37. txt.StudsOffset = Vector3.new(-2, 1, 0)
  38. local text = Instance.new("TextLabel", txt)
  39. text.Size = UDim2.new(3, 0, 0.5, 0)
  40. text.FontSize = "Size8"
  41. text.TextScaled = true
  42. text.TextTransparency = 0
  43. text.BackgroundTransparency = 1
  44. text.TextTransparency = 0
  45. text.TextStrokeTransparency = 0
  46. text.Font = "Arial"
  47. text.TextStrokeColor3 = Color3.new(0,0,0)
  48.  
  49. v=Instance.new("Part")
  50. v.Name = "ColorBrick"
  51. v.Parent=p.Character
  52. v.FormFactor="Symmetric"
  53. v.Anchored=true
  54. v.CanCollide=false
  55. v.BottomSurface="Smooth"
  56. v.TopSurface="Smooth"
  57. v.Size=Vector3.new(10,5,3)
  58. v.Transparency=0.7
  59. v.CFrame=char.Torso.CFrame
  60. v.BrickColor=BrickColor.new(CV)
  61. v.Transparency=1
  62. text.TextColor3 = v.BrickColor.Color
  63. v.Shape="Block"
  64. text.Text = "Red Demon"
  65.  
  66. ----------------------------------------------------
  67. Debounces = {
  68. CanAttack = true;
  69. NoIdl = false;
  70. Slashing = false;
  71. Slashed = false;
  72. RPunch = false;
  73. RPunched = false;
  74. LPunch = false;
  75. LPunched = false;
  76. }
  77. local Touche = {char.Name, }
  78. ----------------------------------------------------
  79. hed.face.Texture = "rbxassetid://0"
  80. char["Body Colors"].HeadColor = BrickColor.new("White")
  81. --------------------------------------
  82. local plr = game:service'Players'.LocalPlayer
  83. local char = plr.Character
  84. local mouse = plr:GetMouse()
  85. local humanoid = char:findFirstChild("Humanoid")
  86. local torso = char:findFirstChild("Torso")
  87. local head = char.Head
  88. local cam = workspace.CurrentCamera
  89. mouse.Button1Down:connect(function()
  90. hit = mouse.Target
  91. if hit ~= nil and hit.Name ~= "Base" then
  92. hit:BreakJoints()
  93. hit.Anchored = false
  94. local bp = Instance.new("BodyPosition", hit)
  95. bp.maxForce = Vector3.new(hit:GetMass()*196.2, hit:GetMass()*196.2,hit:GetMass()*196.2)
  96. bp.D = 500
  97. for _ = 0, 2 do
  98. local p = Instance.new("Part", char)
  99. p.BrickColor = BrickColor.random()
  100. p.Shape = "Ball"
  101. p.FormFactor = "Custom"
  102. p.CFrame = hit.CFrame * CFrame.new(math.random(-1, 1),math.random(-1, 1),math.random(-1, 1))
  103. local bp2 = Instance.new("BodyPosition", p)
  104. bp2.maxForce = Vector3.new(p:GetMass()*196.2, p:GetMass()*196.2,p:GetMass()*196.2)
  105. bp2.D = 3000
  106. bp2.position = head.Position
  107. p.Size = Vector3.new(0.5, 0.5, 0.5)
  108. game:service'Debris':AddItem(p, 1)
  109. end
  110. while hit ~= nil and wait() do
  111. if bp ~= nil then
  112. bp.position = torso.Position
  113. end
  114. if (hit.Position - torso.Position).magnitude < 4 then
  115. hit:Destroy()
  116. break
  117. end
  118. end
  119. end
  120. end)
  121.  
  122. ----------------------------------------------
  123. z = Instance.new("Sound", char)
  124. z.SoundId = "rbxassetid://421766827"--303570180
  125. z.Looped = true
  126. z.Pitch = 1
  127. z.Volume = 1
  128. wait(.1)
  129. z:Play()
  130. ------------------------------
  131. local verlet = {}
  132. verlet.step_time = 1 / 50
  133. verlet.gravity = Vector3.new(0, -10, 0)
  134.  
  135. local char = game.Players.LocalPlayer.Character
  136. local torso = char:WaitForChild("Torso")
  137. local parts = {}
  138. local render = game:GetService("RunService").RenderStepped
  139.  
  140. wait(2)
  141.  
  142. local point = {}
  143. local link = {}
  144. local rope = {}
  145.  
  146. local function ccw(A,B,C)
  147. return (C.y-A.y) * (B.x-A.x) > (B.y-A.y) * (C.x-A.x)
  148. end
  149.  
  150. local function intersect(A,B,C,D)
  151. return ccw(A,C,D) ~= ccw(B,C,D) and ccw(A,B,C) ~= ccw(A,B,D)
  152. end
  153.  
  154. local function vec2(v)
  155. return Vector2.new(v.x, v.z)
  156. end
  157.  
  158. function point:step()
  159. if not self.fixed then
  160. local derivative = (self.position - self.last_position) * 0.95
  161. self.last_position = self.position
  162. self.position = self.position + derivative + (self.velocity * verlet.step_time ^ 2)
  163. --[[local torsoP = torso.CFrame * CFrame.new(-1, 0, 0.5)
  164. local torsoE = torso.CFrame * CFrame.new(1, 0, 0.5)
  165. local pointE = self.position + torso.CFrame.lookVector * 100
  166. local doIntersect = intersect(vec2(torsoP.p), vec2(torsoE.p), vec2(self.position), vec2(pointE))
  167. if not doIntersect then
  168. self.postition = self.position - torso.CFrame.lookVector * 10
  169. end]]
  170. end
  171. end
  172.  
  173. function link:step()
  174. for i = 1, 1 do
  175. local distance = self.point1.position - self.point2.position
  176. local magnitude = distance.magnitude
  177. local differance = (self.length - magnitude) / magnitude
  178. local translation = ((self.point1.fixed or self.point2.fixed) and 1 or 0.6) * distance * differance
  179. if not self.point1.fixed then
  180. self.point1.position = self.point1.position + translation
  181. end
  182. if not self.point2.fixed then
  183. self.point2.position = self.point2.position - translation
  184. end
  185. end
  186. end
  187.  
  188. function verlet.new(class, a, b, c)
  189. if class == "Point" then
  190. local new = {}
  191. setmetatable(new, {__index = point})
  192. new.class = class
  193. new.position = a or Vector3.new()
  194. new.last_position = new.position
  195. new.velocity = verlet.gravity
  196. new.fixed = false
  197. return new
  198. elseif class == "Link" then
  199. local new = {}
  200. setmetatable(new, {__index = link})
  201. new.class = class
  202. new.point1 = a
  203. new.point2 = b
  204. new.length = c or (a.position - b.position).magnitude
  205. return new
  206. elseif class == "Rope" then
  207. local new = {}
  208. setmetatable(new, {__index = link})
  209. new.class = class
  210. new.start_point = a
  211. new.finish_point = b
  212. new.points = {}
  213. new.links = {}
  214. local inc = (b - a) / 10
  215. for i = 0, 10 do
  216. table.insert(new.points, verlet.new("Point", a + (i * inc)))
  217. end
  218. for i = 2, #new.points do
  219. table.insert(new.links, verlet.new("Link", new.points[i - 1], new.points[i]))
  220. end
  221. return new
  222. end
  223. end
  224.  
  225. local tris = {}
  226. local triParts = {}
  227.  
  228. local function GetDiscoColor(hue)
  229. local section = hue % 1 * 3
  230. local secondary = 0.5 * math.pi * (section % 1)
  231. if section < 1 then
  232. return Color3.new(10, 10, 10)
  233. elseif section < 2 then
  234. return Color3.new(10, 10, 10)
  235. else
  236. return Color3.new(10,10, 10)
  237. end
  238. end
  239.  
  240. local function setupPart(part)
  241. part.Anchored = true
  242. part.FormFactor = 3
  243. part.CanCollide = false
  244. part.TopSurface = 10
  245. part.BottomSurface = 10
  246. part.LeftSurface = 10
  247. part.RightSurface = 10
  248. part.FrontSurface = 10
  249. part.BackSurface = 10
  250. part.Material = "Granite"
  251. local m = Instance.new("SpecialMesh", part)
  252. m.MeshType = "Wedge"
  253. m.Scale = Vector3.new(0.2, 1, 1)
  254. return part
  255. end
  256.  
  257. local function CFrameFromTopBack(at, top, back)
  258. local right = top:Cross(back)
  259. return CFrame.new(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  260. end
  261.  
  262. local function drawTri(parent, a, b, c)
  263. local this = {}
  264. local mPart1 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  265. local mPart2 = table.remove(triParts, 1) or setupPart(Instance.new("Part"))
  266. function this:Set(a, b, c)
  267. local ab, bc, ca = b-a, c-b, a-c
  268. local abm, bcm, cam = ab.magnitude, bc.magnitude, ca.magnitude
  269. local edg1 = math.abs(0.5 + ca:Dot(ab)/(abm*abm))
  270. local edg2 = math.abs(0.5 + ab:Dot(bc)/(bcm*bcm))
  271. local edg3 = math.abs(0.5 + bc:Dot(ca)/(cam*cam))
  272. if edg1 < edg2 then
  273. if edg1 >= edg3 then
  274. a, b, c = c, a, b
  275. ab, bc, ca = ca, ab, bc
  276. abm = cam
  277. end
  278. else
  279. if edg2 < edg3 then
  280. a, b, c = b, c, a
  281. ab, bc, ca = bc, ca, ab
  282. abm = bcm
  283. else
  284. a, b, c = c, a, b
  285. ab, bc, ca = ca, ab, bc
  286. abm = cam
  287. end
  288. end
  289.  
  290. local len1 = -ca:Dot(ab)/abm
  291. local len2 = abm - len1
  292. local width = (ca + ab.unit*len1).magnitude
  293.  
  294. local maincf = CFrameFromTopBack(a, ab:Cross(bc).unit, -ab.unit)
  295.  
  296. if len1 > 0.2 then
  297. mPart1.Parent = parent
  298. mPart1.Size = Vector3.new(0.2, width, len1)
  299. mPart1.CFrame = maincf*CFrame.Angles(math.pi,0,math.pi/2)*CFrame.new(0,width/2,len1/2)
  300. else
  301. mPart1.Parent = nil
  302. end
  303.  
  304. if len2 > 0.2 then
  305. mPart2.Parent = parent
  306. mPart2.Size = Vector3.new(0.2, width, len2)
  307. mPart2.CFrame = maincf*CFrame.Angles(math.pi,math.pi,-math.pi/2)*CFrame.new(0,width/2,-len1 - len2/2)
  308. else
  309. mPart2.Parent = nil
  310. end
  311. end
  312. function this:SetProperty(prop, value)
  313. mPart1[prop] = value
  314. mPart2[prop] = value
  315. end
  316. this:Set(a, b, c)
  317. function this:Destroy()
  318. mPart1:Destroy()
  319. mPart2:Destroy()
  320. end
  321. this.p1 = mPart1
  322. this.p2 = mPart2
  323. this.p1.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p1.CFrame.Y * 0.5 + time())))
  324. this.p2.BrickColor = BrickColor.new(GetDiscoColor(math.noise(0.5, 0.5, this.p2.CFrame.Y * 0.5 + time())))
  325. return this
  326. end
  327.  
  328. function verlet.draw(object, id)
  329. if object.class == "Point" then
  330. local part = parts[id]
  331. part.BrickColor = BrickColor.new(107, 0, 107)
  332. part.Transparency = 0
  333. part.formFactor = 3
  334. part.Anchored = true
  335. part.CanCollide = false
  336. part.TopSurface = 0
  337. part.BottomSurface = 0
  338. part.Size = Vector3.new(0.35, 0.35, 0.35)
  339. part.Material = "Smooth plastic"
  340. part.CFrame = CFrame.new(object.position)
  341. part.Parent = torso
  342. return part
  343. elseif object.class == "Link" then
  344. local part = parts[id]
  345. local dist = (object.point1.position - object.point2.position).magnitude
  346. part.Size = Vector3.new(0.2, 0.2, dist)
  347. part.CFrame = CFrame.new(object.point1.position, object.point2.position) * CFrame.new(0, 0, dist * -0.5)
  348. part.Parent = torso
  349. return part
  350. end
  351. end
  352.  
  353. function verlet.clear()
  354. for _, v in pairs(workspace:GetChildren()) do
  355. if v.Name == "Part" then
  356. v:Destroy()
  357. end
  358. end
  359. end
  360.  
  361. local points = {}
  362. local links = {}
  363.  
  364. for x = 0, 2 do
  365. points[x] = {}
  366. for y = 0, 3 do
  367. points[x][y] = verlet.new("Point", torso.Position + Vector3.new(x * 0.8 - 2, 2 - y * 0.8, 5 + y * 0.4))
  368. points[x][y].fixed = y == 0
  369. end
  370. end
  371.  
  372. for x = 1, 2 do
  373. for y = 0, 3 do
  374. links[#links + 1] = verlet.new("Link", points[x][y], points[x - 1][y], 1 + y * 0.08)
  375. end
  376. end
  377.  
  378. for x = 0, 2 do
  379. for y = 1, 3 do
  380. links[#links + 1] = verlet.new("Link", points[x][y], points[x][y - 1], 1.2 + y * 0.03)
  381. end
  382. end
  383.  
  384. render:connect(function()
  385. for x = 0, 2 do
  386. for y = 0, 3 do
  387. if y == 0 then
  388. points[x][y].position = (torso.CFrame * CFrame.new(x * 1 - 1, 1, 0.5)).p
  389. else
  390. points[x][y]:step()
  391. end
  392. end
  393. end
  394. for i = 1, #links do
  395. links[i]:step()
  396. end
  397. for i = 1, #tris do
  398. triParts[#triParts + 1] = tris[i].p1
  399. triParts[#triParts + 1] = tris[i].p2
  400. end
  401. tris = {}
  402. for x = 1, 2 do
  403. for y = 1, 3 do
  404. tris[#tris + 1] = drawTri(torso, points[x - 1][y - 1].position, points[x - 1][y].position, points[x][y - 1].position)
  405. tris[#tris + 1] = drawTri(torso, points[x][y].position, points[x - 1][y].position, points[x][y - 1].position)
  406. end
  407. end
  408. end)
  409.  
  410. ----------------------
  411. do --CFrame lerp (stravant, clerp by AntiBoomz0r)
  412. local function QuaternionFromCFrame(cf)
  413. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  414. local trace = m00 + m11 + m22
  415. if trace > 0 then
  416. local s = math.sqrt(1 + trace)
  417. local recip = 0.5/s
  418. return (m21-m12)*recip, (m02-m20)*recip, (m10-m01)*recip, s*0.5
  419. else
  420. local i = 0
  421. if m11 > m00 then
  422. i = 1
  423. end
  424. if m22 > (i == 0 and m00 or m11) then
  425. i = 2
  426. end
  427. if i == 0 then
  428. local s = math.sqrt(m00-m11-m22+1)
  429. local recip = 0.5/s
  430. return 0.5*s, (m10+m01)*recip, (m20+m02)*recip, (m21-m12)*recip
  431. elseif i == 1 then
  432. local s = math.sqrt(m11-m22-m00+1)
  433. local recip = 0.5/s
  434. return (m01+m10)*recip, 0.5*s, (m21+m12)*recip, (m02-m20)*recip
  435. elseif i == 2 then
  436. local s = math.sqrt(m22-m00-m11+1)
  437. local recip = 0.5/s return (m02+m20)*recip, (m12+m21)*recip, 0.5*s, (m10-m01)*recip
  438. end
  439. end
  440. end
  441. local function QuaternionToCFrame(px, py, pz, x, y, z, w)
  442. local xs, ys, zs = x + x, y + y, z + z
  443. local wx, wy, wz = w*xs, w*ys, w*zs
  444. local xx = x*xs
  445. local xy = x*ys
  446. local xz = x*zs
  447. local yy = y*ys
  448. local yz = y*zs
  449. local zz = z*zs
  450. return CFrame.new(px, py, pz,1-(yy+zz), xy - wz, xz + wy,xy + wz, 1-(xx+zz), yz - wx, xz - wy, yz + wx, 1-(xx+yy))
  451. end
  452. function QuaternionSlerp(a, b, t)
  453. local cosTheta = a[1]*b[1] + a[2]*b[2] + a[3]*b[3] + a[4]*b[4]
  454. local startInterp, finishInterp;
  455. if cosTheta >= 0.0001 then
  456. if (1 - cosTheta) > 0.0001 then
  457. local theta = math.acos(cosTheta)
  458. local invSinTheta = 1/math.sin(theta)
  459. startInterp = math.sin((1-t)*theta)*invSinTheta
  460. finishInterp = math.sin(t*theta)*invSinTheta
  461. else
  462. startInterp = 1-t
  463. finishInterp = t
  464. end
  465. else
  466. if (1+cosTheta) > 0.0001 then
  467. local theta = math.acos(-cosTheta)
  468. local invSinTheta = 1/math.sin(theta)
  469. startInterp = math.sin((t-1)*theta)*invSinTheta
  470. finishInterp = math.sin(t*theta)*invSinTheta
  471. else
  472. startInterp = t-1
  473. finishInterp = t
  474. end
  475. end
  476. return a[1]*startInterp + b[1]*finishInterp, a[2]*startInterp + b[2]*finishInterp, a[3]*startInterp + b[3]*finishInterp, a[4]*startInterp + b[4]*finishInterp
  477. end
  478. function clerp(a,b,t)
  479. local qa = {QuaternionFromCFrame(a)}
  480. local qb = {QuaternionFromCFrame(b)}
  481. local ax, ay, az = a.x, a.y, a.z
  482. local bx, by, bz = b.x, b.y, b.z
  483. local _t = 1-t
  484. return QuaternionToCFrame(_t*ax + t*bx, _t*ay + t*by, _t*az + t*bz,QuaternionSlerp(qa, qb, t))
  485. end
  486. end
  487.  
  488. plr = game:service'Players'.LocalPlayer
  489. char = plr.Character
  490. mouse = plr:GetMouse()
  491. humanoid = char:findFirstChild("Humanoid")
  492. torso = char:findFirstChild("Torso")
  493. head = char.Head
  494. ra = char:findFirstChild("Right Arm")
  495. la = char:findFirstChild("Left Arm")
  496. rl = char:findFirstChild("Right Leg")
  497. ll = char:findFirstChild("Left Leg")
  498. rs = torso:findFirstChild("Right Shoulder")
  499. ls = torso:findFirstChild("Left Shoulder")
  500. rh = torso:findFirstChild("Right Hip")
  501. lh = torso:findFirstChild("Left Hip")
  502. neck = torso:findFirstChild("Neck")
  503. rj = char:findFirstChild("HumanoidRootPart"):findFirstChild("RootJoint")
  504. animate = char:findFirstChild("Animate")
  505. if animate then
  506. animate:Destroy()
  507. end
  508. rootpart = char:findFirstChild("HumanoidRootPart")
  509. camera = workspace.CurrentCamera
  510.  
  511. gun = Instance.new("Model", char)
  512. gun.Name = "GunModel"
  513.  
  514. local rm = Instance.new("Motor", torso)
  515. rm.C0 = CFrame.new(1.5, 0.5, 0)
  516. rm.C1 = CFrame.new(0, 0.5, 0)
  517. rm.Part0 = torso
  518. rm.Part1 = ra
  519.  
  520. local lm = Instance.new("Motor", torso)
  521. lm.C0 = CFrame.new(-1.5, 0.5, 0)
  522. lm.C1 = CFrame.new(0, 0.5, 0)
  523. lm.Part0 = torso
  524. lm.Part1 = la
  525.  
  526. local rlegm = Instance.new("Motor", torso)
  527. rlegm.C0 = CFrame.new(0.5, -1, 0)
  528. rlegm.C1 = CFrame.new(0, 1, 0)
  529. rlegm.Part0 = torso
  530. rlegm.Part1 = rl
  531. rlegm.Name = "Right Hip"
  532.  
  533. local llegm = Instance.new("Motor", torso)
  534. llegm.C0 = CFrame.new(-0.5, -1, 0)
  535. llegm.C1 = CFrame.new(0, 1, 0)
  536. llegm.Part0 = torso
  537. llegm.Part1 = ll
  538. llegm.Name = "Left Hip"
  539.  
  540. neck.C0 = CFrame.new(0, 1, 0)
  541. neck.C1 = CFrame.new(0, -0.5, 0)
  542.  
  543. rj.C0 = CFrame.new(0, -1.5, 0)
  544. rj.C1 = CFrame.new(0, -1.5, 0)
  545.  
  546. --[[local hydrotankbase = Instance.new("Part", gun)
  547. hydrotankbase.BrickColor = BrickColor.Black()
  548. hydrotankbase.FormFactor = 'Custom'
  549. hydrotankbase.CanCollide = false
  550. hydrotankbase.Material = 'SmoothPlastic'
  551. hydrotankbase.TopSurface = 'SmoothNoOutlines'
  552. hydrotankbase.BottomSurface = 'SmoothNoOutlines'
  553. hydrotankbase.LeftSurface = 'SmoothNoOutlines'
  554. hydrotankbase.RightSurface = 'SmoothNoOutlines'
  555. hydrotankbase.BackSurface = 'SmoothNoOutlines'
  556. hydrotankbase.FrontSurface = 'SmoothNoOutlines'
  557. hydrotankbase.Size = Vector3.new(1.2, .2, 1.2)
  558. Instance.new("CylinderMesh", hydrotankbase)
  559. local weld = Instance.new("Weld", hydrotankbase)
  560. weld.C0 = CFrame.new(torso.Size.x/2 - hydrotankbase.Size.x/2, .45, -torso.Size.z/2 - (hydrotankbase.Size.z/3))
  561. weld.Part0 = hydrotankbase
  562. weld.Part1 = torso
  563. local hydrotankbase2 = hydrotankbase:clone()
  564. hydrotankbase2.Parent = gun
  565. local weld = Instance.new("Weld", hydrotankbase)
  566. weld.C0 = CFrame.new(-torso.Size.x/2 + hydrotankbase2.Size.x/2, .45, -torso.Size.z/2 - (hydrotankbase2.Size.z/3))
  567. weld.Part0 = hydrotankbase2
  568. weld.Part1 = torso
  569. local hydroglass = hydrotankbase:clone()
  570. hydroglass.Parent = gun
  571. hydroglass.Size = Vector3.new(1.1, 1.5, 1.1)
  572. hydroglass.BrickColor = BrickColor.White()
  573. hydroglass.Transparency = .2
  574. local weld = Instance.new("Weld", hydroglass)
  575. weld.C0 = CFrame.new(0, -hydrotankbase.Size.y/2 - hydroglass.Size.y/2, 0)
  576. weld.Part0 = hydroglass
  577. weld.Part1 = hydrotankbase
  578. local hydroglass2 = hydroglass:clone()
  579. hydroglass2.Parent = gun
  580. local weld = Instance.new("Weld", hydrotankbase)
  581. weld.C0 = CFrame.new(0, -hydrotankbase.Size.y/2 - hydroglass2.Size.y/2, 0)
  582. weld.Part0 = hydroglass2
  583. weld.Part1 = hydrotankbase2
  584. local hydrotanktop = hydrotankbase:clone()
  585. hydrotanktop.Parent = gun
  586. local weld = Instance.new("Weld", hydrotankbase)
  587. weld.C0 = CFrame.new(0,- hydroglass2.Size.y/2 - hydrotanktop.Size.y/2,0)
  588. weld.Part0 = hydrotanktop
  589. weld.Part1 = hydroglass
  590. local hydrotanktop2 = hydrotankbase:clone()
  591. hydrotanktop2.Parent = gun
  592. local weld = Instance.new("Weld", hydrotankbase)
  593. weld.C0 = CFrame.new(0,- hydroglass2.Size.y/2 - hydrotanktop2.Size.y/2,0)
  594. weld.Part0 = hydrotanktop2
  595. weld.Part1 = hydroglass2
  596.  
  597. local hydrogen = hydrotankbase:clone()
  598. hydrogen.Parent = gun
  599. hydrogen.Material = 'Pebble'
  600. hydrogen.Size = Vector3.new(1, 1.5, 1)
  601. hydrogen.BrickColor = BrickColor.Blue()
  602. local weld = Instance.new("Weld", hydrogen)
  603. weld.C0 = CFrame.new(0, -hydrotankbase.Size.y/2 - hydroglass.Size.y/2, 0)
  604. weld.Part0 = hydrogen
  605. weld.Part1 = hydrotankbase
  606. local hydrogen2 = hydrogen:clone()
  607. hydrogen2.Parent = gun
  608. local weld = Instance.new("Weld", hydrogen2)
  609. weld.C0 = CFrame.new(0, -hydrotankbase.Size.y/2 - hydroglass2.Size.y/2, 0)
  610. weld.Part0 = hydrogen2
  611. weld.Part1 = hydrotankbase2]]--
  612.  
  613. rsc0 = rm.C0
  614. lsc0 = lm.C0
  615. neckc0 = neck.C0
  616. rootc0 = rj.C0
  617. llc0 = llegm.C0
  618. rlc0 = rlegm.C0
  619. speed = 0.25
  620. angle = 0
  621. mvmnt = 0
  622. anglespeed = 1
  623. humanoid.WalkSpeed = 8
  624. ctrl = false
  625. stopsprint = false
  626. action = false
  627. sprinting = false
  628. mouse.KeyDown:connect(function(k)
  629. repeat wait() until action == false
  630. if not action then
  631. if k:byte() == 48 then
  632. sprinting = true
  633. humanoid.WalkSpeed = 16
  634. end
  635. if k == '2' then
  636. ctrl = true
  637. humanoid.WalkSpeed = 5
  638. end
  639. end
  640. end)
  641.  
  642. mouse.KeyUp:connect(function(k)
  643. repeat wait() until action == false
  644. if not action then
  645. repeat wait() until action == false
  646. if k:byte() == 48 then
  647. sprinting = false
  648. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 10 and hitz then
  649. action = 'StopSprinting'
  650. end
  651. humanoid.WalkSpeed = 8
  652. if ctrl then
  653. humanoid.WalkSpeed = 5
  654. end
  655. end
  656. if k == '2' then
  657. ctrl = false
  658. humanoid.WalkSpeed = 8
  659. end
  660. end
  661. end)
  662.  
  663. Controls = game:service'ControllerService':children()[1]
  664.  
  665. local fakehead = head:clone()
  666. fakehead.Parent = head
  667. head.Transparency = 1
  668. for i,v in pairs(fakehead:children()) do
  669. if v:IsA'Sound' or v:IsA'Sound' then
  670. v:Destroy()
  671. end
  672. end
  673.  
  674. waitingloop = false
  675.  
  676. local fakeweld = Instance.new("Weld", head)
  677. fakeweld.Part0 = head
  678. fakeweld.Part1 = fakehead
  679.  
  680. humanoid.Jumping:connect(function()
  681. if not action then
  682. action = 'Jumping'
  683. end
  684. end)
  685.  
  686. game:service'RunService'.RenderStepped:connect(function()
  687. if not loopedaction then
  688. local rscf = rsc0
  689. local lscf = lsc0
  690. local rlcf = rlc0
  691. local llcf = llc0
  692. local rjcf = rootc0
  693. local ncf = neckc0
  694. local rayz = Ray.new(rootpart.Position, Vector3.new(0, -4.1, 0))
  695. local hitz, enz = workspace:findPartOnRay(rayz, char)
  696. angle = (angle % 100) + anglespeed/10
  697. mvmnt = math.pi * math.sin(math.pi*2/100*(angle*10))
  698. if action ~= false then
  699. if action == 'StopSprinting' then
  700. Controls.Parent = nil
  701. local bodyvelocity = Instance.new("BodyVelocity", rootpart)
  702. bodyvelocity.maxForce = Vector3.new(1/0,0,1/0)
  703. bodyvelocity.velocity = rootpart.CFrame.lookVector * 16
  704. ncf = neckc0 * CFrame.Angles(math.rad(-15), -math.rad(65), 0)
  705. rscf = rsc0 * CFrame.Angles(math.rad(-22), 0, math.rad(20.5))
  706. lscf = lsc0 * CFrame.Angles(math.rad(-54.5), 0, -math.rad(18.5))
  707. rjcf = rootc0 * CFrame.new(0, -.35, 0) * CFrame.Angles(math.rad(35), math.rad(70), 0)
  708. llcf = llc0 * CFrame.new(0, .25, -.25) * CFrame.Angles(0, 0, -math.rad(58))
  709. rlcf = rlcf * CFrame.new(0, -.25, -.15) * CFrame.Angles(0, 0, math.rad(10))
  710. loopedaction = true
  711. for i = 0, 25 do
  712. bodyvelocity.velocity = rootpart.CFrame.lookVector * (16 - i/2)
  713. rm.C0 = clerp(rm.C0,rscf,speed)
  714. lm.C0 = clerp(lm.C0,lscf,speed)
  715. rj.C0 = clerp(rj.C0,rjcf,speed)
  716. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  717. llegm.C0 = clerp(llegm.C0,llcf,speed)
  718. neck.C0 = clerp(neck.C0,ncf,speed)
  719. wait()
  720. end
  721. bodyvelocity:Destroy()
  722. loopedaction = false
  723. stopsprint = false
  724. action = false
  725. Controls.Parent = game:service'ControllerService'
  726. humanoid.WalkSpeed = 8
  727. if ctrl then
  728. humanoid.WalkSpeed = 5
  729. end
  730. end
  731. if action == 'Jumping' then
  732. loopedaction = true
  733. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  734. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  735. rscf = rsc0 * CFrame.Angles(-math.pi/16, -math.sin(angle)*0.08, 0)
  736. lscf = lsc0 * CFrame.Angles(-math.pi/17, math.sin(angle)*0.08, 0)
  737. rlcf = rlc0 * CFrame.Angles(-math.pi/16+-math.sin(angle)*0.125, -math.sin(angle)*0.08, math.rad(2.5))
  738. llcf = llc0 * CFrame.Angles(-math.pi/17+-math.sin(angle)*0.125, math.sin(angle)*0.08, -math.rad(2.5))
  739. for i = 0, 12 do
  740. rm.C0 = clerp(rm.C0,rscf,speed)
  741. lm.C0 = clerp(lm.C0,lscf,speed)
  742. rj.C0 = clerp(rj.C0,rjcf,speed)
  743. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  744. llegm.C0 = clerp(llegm.C0,llcf,speed)
  745. neck.C0 = clerp(neck.C0,ncf,speed)
  746. wait()
  747. end
  748. loopedaction = false
  749. action = false
  750. end
  751. end
  752. if goinup and torso.Velocity.y <= 2 then
  753. goinup = false
  754. if ctrl then
  755. humanoid.WalkSpeed = 5
  756. elseif sprinting then
  757. humanoid.WalkSpeed = 16
  758. elseif not sprinting and not ctrl then
  759. humanoid.WalkSpeed = 8
  760. end
  761. end
  762. if not action then
  763. if not hitz then
  764. anglespeed = 1
  765. if Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
  766. if not waitingloop then
  767. waitingloop = true
  768. coroutine.wrap(function()
  769. repeat wait() until hitz
  770. action = 'StopSprinting'
  771. end)()
  772. end
  773. end
  774. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  775. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  776. rscf = rsc0 * CFrame.Angles(-math.pi/19, -math.sin(angle)*0.08, math.rad(20.5))
  777. lscf = lsc0 * CFrame.Angles(-math.pi/24, math.sin(angle)*0.08, -math.rad(20.5))
  778. rlcf = rlc0 * CFrame.Angles(math.pi/24+-math.sin(angle)*0.025, -math.sin(angle)*0.08, math.rad(2.5))
  779. llcf = llc0 * CFrame.Angles(math.pi/24+-math.sin(angle)*0.025, math.sin(angle)*0.08, -math.rad(2.5))
  780. elseif torso.Velocity.y >= 2 and hitz then
  781. anglespeed = 1.75
  782. goinup = true
  783. humanoid.WalkSpeed = 5
  784. rjcf = rootc0 * CFrame.Angles(-math.pi/64, 0, 0)
  785. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*.5, 0, -math.abs(mvmnt)*0.02)
  786. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*.5, 0, math.abs(mvmnt)*0.02)
  787. rlcf = rlc0 * CFrame.new(0, .45+math.abs(math.sin(angle))*.4, -.25+math.sin(angle)*0.2) * CFrame.Angles(math.sin(-angle)*.45, 0, math.rad(.5))
  788. llcf = llc0 * CFrame.new(0, .85-math.abs(math.sin(angle))*.4, -.25-math.sin(angle)*0.2) * CFrame.Angles(math.sin(angle)*.45, 0, -math.rad(.5))
  789. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 2 then
  790. if not goinup then
  791. if stopsprint then
  792. action = 'StopSprinting'
  793. end
  794. anglespeed = 0.15
  795. if ctrl then
  796. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  797. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, 0)
  798. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, 0)
  799. rjcf = rootc0 * CFrame.new(0, -1.25, 0)
  800. llcf = llc0 * CFrame.new(0, 0, -.45) * CFrame.Angles(-math.pi/2.2, 0, 0)
  801. rlcf = rlcf * CFrame.new(0, 1.25, -.85)
  802. elseif not ctrl then
  803. ncf = neckc0 * CFrame.Angles(-math.sin(angle)*0.07, 0, 0)
  804. rjcf = rootc0 * CFrame.Angles(math.sin(angle)*0.025, 0, 0)
  805. rscf = rsc0 * CFrame.Angles(0, -math.sin(angle)*0.08, 0)
  806. lscf = lsc0 * CFrame.Angles(0, math.sin(angle)*0.08, 0)
  807. rlcf = rlc0 * CFrame.Angles(-math.sin(angle)*0.025, -math.sin(angle)*0.08, math.rad(2.5))
  808. llcf = llc0 * CFrame.Angles(-math.sin(angle)*0.025, math.sin(angle)*0.08, -math.rad(2.5))
  809. end
  810. end
  811. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude <= 10 then
  812. if not goinup then
  813. if stopsprint then
  814. action = 'StopSprinting'
  815. end
  816. anglespeed = 1.5
  817. if ctrl then
  818. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*.5, 0, -math.abs(mvmnt)*0.02)
  819. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*.5, 0, math.abs(mvmnt)*0.02)
  820. rjcf = rootc0 * CFrame.new(0, -.7, 0) * CFrame.Angles(-math.pi/32, 0, 0)
  821. llcf = llc0 * CFrame.new(0, .65, -.5 + (-.4+math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 - math.sin(angle)*.45, 0, 0)
  822. rlcf = rlcf * CFrame.new(0, .65, -.5 + (-.25-math.sin(angle)*0.25)) * CFrame.Angles(math.pi/18 + -math.pi/10 + math.sin(angle)*.45, 0, 0)
  823. else
  824. rjcf = rootc0 * CFrame.Angles(-math.pi/64, 0, 0)
  825. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*.5, 0, -math.abs(mvmnt)*0.02)
  826. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*.5, 0, math.abs(mvmnt)*0.02)
  827. rlcf = rlc0 * CFrame.new(0, 0, -.15+math.sin(angle)*0.1) * CFrame.Angles(math.sin(-angle)*.45, 0, math.rad(.5))
  828. llcf = llc0 * CFrame.new(0, 0, -.15-math.sin(angle)*0.1) * CFrame.Angles(math.sin(angle)*.45, 0, -math.rad(.5))
  829. end
  830. end
  831. elseif Vector3.new(torso.Velocity.x, 0, torso.Velocity.z).magnitude >= 15 then
  832. if not goinup then
  833. stopsprint = true --when released
  834. anglespeed = 2
  835. local RotVelocityZ = torso.RotVelocity.Y
  836. if RotVelocityZ >= 15 then
  837. RotVelocityZ = 15
  838. elseif RotVelocityZ <= -15 then
  839. RotVelocityZ = -15
  840. end
  841. ncf = neckc0 * CFrame.Angles(0, -math.sin(angle)*.1, 0)
  842. rscf = rsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(angle)*1.1, 0, -math.abs(mvmnt)*0.02)
  843. lscf = lsc0 * CFrame.new(0, 0, math.sin(angle)*0.125) * CFrame.Angles(math.pi/24+math.sin(-angle)*1.1, 0, math.abs(mvmnt)*0.02)
  844. rjcf = rootc0 * CFrame.new(0, 0, 0) * CFrame.Angles(-math.pi/18, math.sin(angle)*.1, math.sin(angle)*.045 + math.rad(RotVelocityZ)*2.5)
  845. rlcf = rlc0 * CFrame.new(0, 0, -.6+math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(-angle)*1.3, 0, math.rad(.5))
  846. llcf = llc0 * CFrame.new(0, 0, -math.abs(mvmnt)*0.125) * CFrame.Angles(-math.pi/18+math.sin(angle)*1.3, 0, -math.rad(.5))
  847. end
  848. end
  849. end
  850. rm.C0 = clerp(rm.C0,rscf,speed)
  851. lm.C0 = clerp(lm.C0,lscf,speed)
  852. rj.C0 = clerp(rj.C0,rjcf,speed)
  853. rlegm.C0 = clerp(rlegm.C0,rlcf,speed)
  854. llegm.C0 = clerp(llegm.C0,llcf,speed)
  855. neck.C0 = clerp(neck.C0,ncf,speed)
  856. end
  857. end)
  858. ------------------------------------
  859. ply = game.Players.LocalPlayer
  860. char = ply.Character
  861. torso = char.Torso
  862. attacking = false
  863. track = false
  864. curcam = Workspace.CurrentCamera
  865. name = 'KFM'
  866.  
  867. pcall(function() char:FindFirstChild("legetony"):Remove() char:FindFirstChild("Belt"):Remove() end)
  868. m = Instance.new("Model",char) m.Name = "legetony"
  869.  
  870. cfn,ang = CFrame.new,CFrame.Angles
  871. v3n = Vector3.new
  872.  
  873. rs = torso["Right Shoulder"]
  874. ls = torso["Left Shoulder"]
  875. rh = torso["Right Hip"]
  876. lh = torso["Right Hip"]
  877. neck = torso["Neck"]
  878. rw,lw = nil,nil
  879. rhw,lhw = nil,nil
  880. local orgc1 = rs.C1
  881.  
  882. rarm = char["Right Arm"]
  883. larm = char["Left Arm"]
  884. rleg = char["Right Leg"]
  885. lleg = char["Left Leg"]
  886.  
  887. normposr = cfn(1.5,.5,0)
  888. normposl = cfn(-1.5,.5,0)
  889. normposr2 = cfn(-.5,-1.5,0)
  890. normposl2 = cfn(.5,-1.5,0)
  891. normposn = CFrame.new(0,1,0,-1,-0,-0,0,0,1,0,1,0)
  892.  
  893. holdpos = normposr*ang(math.pi/2,0,0)
  894. holdpos2 = normposl*ang(math.pi/2,0,0)
  895.  
  896. lock = {["R"] =
  897. function(a)
  898. if a == 1 then
  899. rabrick = T.P(1,1,1,"White",1,false,false)
  900. rw = T.W(rabrick,torso,1.5,.5,0,0,0,0)
  901. T.W(rarm,rabrick,0,-.5,0,0,0,0)
  902. elseif a == 2 then
  903. rlbrick = T.P(1,1,1,"White",1,false,false)
  904. rhw = T.W(rlbrick,torso,-.5,-1.5,0,0,0,0)
  905. T.W(rleg,rlbrick,0,-.5,0,0,0,0)
  906. elseif a == 0 then
  907. rs.Parent = torso
  908. rw.Parent = nil
  909. rabrick:Destroy() rabrick = nil
  910. elseif a == -1 then
  911. rhw.Parent = nil
  912. rh.Parent = torso
  913. rlbrick:Destroy() rlbrick = nil
  914. end
  915. end
  916. , ["L"] = function(a)
  917. if a == 1 then
  918. labrick = T.P(1,1,1,"White",1,false,false)
  919. lw = T.W(labrick,torso,-1.5,.5,0,0,0,0)
  920. T.W(larm,labrick,0,-.5,0,0,0,0)
  921. elseif a == 2 then
  922. llbrick = T.P(1,1,1,"White",1,false,false)
  923. lhw = T.W(llbrick,torso,.5,-1.5,0,0,0,0)
  924. T.W(lleg,llbrick,0,-.5,0,0,0,0)
  925. elseif a == 0 then
  926. ls.Parent = torso
  927. lw.Parent = nil
  928. labrick:Destroy() labrick = nil
  929. elseif a == -1 then
  930. lhw.Parent = nil
  931. lh.Parent = torso
  932. llbrick:Destroy() llbrick = nil
  933. end
  934. end}
  935.  
  936. ------TOOOOOLS------
  937. T = {["P"] = function(x,y,z,color,transparency,cancollide,anchored,parent,typee)
  938. if typee ~= nil then
  939. c = Instance.new("WedgePart",m)
  940. else
  941. c = Instance.new("Part",m)
  942. end
  943. c.TopSurface,c.BottomSurface = 0,0
  944. c.formFactor = "Custom"
  945. c.Size = Vector3.new(x,y,z)
  946. if color ~= "random" then
  947. c.BrickColor = BrickColor.new(color)
  948. else c.BrickColor = BrickColor:random() end
  949. c.Transparency = transparency
  950. c.CanCollide = cancollide
  951. if anchored ~= nil then c.Anchored = anchored end
  952. if parent ~= nil then c.Parent = parent end
  953. return c
  954.  
  955. end
  956. ,
  957. ["C"] = function(func) coroutine.resume(coroutine.create(func)) end
  958. ,
  959. ["W"] = function(part0,part1,x,y,z,rx,ry,rz,parent)
  960. w = Instance.new("Motor",m)
  961. if parent ~= nil then w.Parent = parent end
  962. w.Part0,w.Part1 = part0,part1
  963. w.C1 = CFrame.new(x,y,z) * CFrame.Angles(rx,ry,rz)
  964. return w
  965. end
  966. ,
  967. ["BG"] = function(parent)
  968. local c = Instance.new("BodyGyro",parent)
  969. c.P = 20e+003
  970. c.cframe = parent.CFrame
  971. c.maxTorque = Vector3.new(c.P,c.P,c.P)
  972. return c
  973. end
  974. ,
  975. ["BP"] = function(parent,position)
  976. local bp = Instance.new("BodyPosition",parent)
  977. bp.maxForce = Vector3.new()*math.huge
  978. bp.position = position
  979. return bp
  980. end
  981. ,
  982. ["F"] = function(parent,size,heat,color,secondcolor,enabled)
  983. f = Instance.new("Fire",parent)
  984. f.Size = size
  985. f.Heat = heat
  986. if enabled ~= nil then f.Enabled = enabled end
  987. if color ~= nil then f.Color = BrickColor.new(color).Color end
  988. if secondcolor ~= nil then f.SecondaryColor = BrickColor.new(secondcolor).Color end
  989. return f
  990. end
  991. ,
  992. ["FM"] = function(parent,meshid,x,y,z,meshtexture)
  993. if meshid == "cylinder" then
  994. mesh = Instance.new("CylinderMesh",parent)
  995. mesh.Scale = Vector3.new(x,y,z)
  996. return mesh
  997. else
  998. mesh = Instance.new("SpecialMesh",parent)
  999.  
  1000. if meshid ~= "sphere" then
  1001. if type(meshid) == "number" then mesh.MeshId = "rbxassetid://"..meshid else
  1002. mesh.MeshId = "rbxassetid://"..meshids[meshid]
  1003. end
  1004.  
  1005. else mesh.MeshType = 3 end
  1006.  
  1007. mesh.Scale = Vector3.new(x,y,z)
  1008.  
  1009. if meshtexture ~= nil then
  1010. if type(meshtexture) == "number" then mesh.TextureId = "rbxassetid://"..meshtexture else
  1011. mesh.TextureId = "rbxassetid://"..textureids[meshtexture] end
  1012.  
  1013. end
  1014.  
  1015. return mesh
  1016. end
  1017. end
  1018. ,
  1019. ["Track"] = function(obj,s,t,lt,color,fade)
  1020. coroutine.resume(coroutine.create(function()
  1021. while track do
  1022. old = obj.Position
  1023. wait()
  1024. new = obj.Position
  1025.  
  1026. mag = (old-new).magnitude
  1027. dist = (old+new)/2
  1028.  
  1029. local ray = T.P(s,mag+.2,s,obj.Color,t,false,true)
  1030. Instance.new("CylinderMesh",ray)
  1031. ray.CFrame = CFrame.new(dist,old)*ang(math.pi/2,0,0)
  1032. if fade ~= nil then
  1033. delay(lt,function()
  1034. for i = t,1,fade do wait() ray.Transparency = i end ray:Remove() end)
  1035. else
  1036. game:GetService("Debris"):AddItem(ray,lt)
  1037. end
  1038. if color ~= nil then ray.BrickColor = BrickColor.new(color) end
  1039.  
  1040. end
  1041. end)) end
  1042. }
  1043. --------------------------------------------------
  1044. ----------------DAMAGE FUNCTION--------------------
  1045. function damage(hit,amount,show,del,poikkeus)
  1046. for i,v in pairs(hit:GetChildren()) do
  1047. if v:IsA("Humanoid") and v.Parent ~= char then
  1048.  
  1049. amo = 0
  1050. function showa(p)
  1051. if show == true then
  1052. for i,o in pairs(p:GetChildren()) do
  1053. if o:IsA("BillboardGui") and o.Name == "satuttava" then
  1054. amo = amo+1
  1055. end end
  1056.  
  1057.  
  1058. local bbg = Instance.new("BillboardGui",p)
  1059. bbg.Adornee = p.Torso
  1060. bbg.Name = "satuttava"
  1061. bbg.Size = UDim2.new(2,0,2,0)
  1062. bbg.StudsOffset = Vector3.new(0,6+amo*2,0)
  1063.  
  1064. local box = Instance.new("TextLabel",bbg)
  1065. box.Size = UDim2.new(1,0,1,0)
  1066. box.BackgroundColor = BrickColor.new("White")
  1067. box.Text = amount
  1068. box.BackgroundTransparency = .5
  1069. if amount == 0 then box.Text = "K.O" end
  1070. box.Position = UDim2.new(0,0,0,0)
  1071. box.TextScaled = true
  1072. game:GetService("Debris"):AddItem(bbg,.5)
  1073. end
  1074. end
  1075.  
  1076. function dame(q)
  1077. if poikkeus ~= nil then
  1078. for _,u in pairs(poikkeus) do
  1079. if q.Parent.Name ~= u then
  1080. showa(q)
  1081. if amount == 0 then q.Parent:BreakJoints() end
  1082. q.Health = q.Health - amount
  1083. end
  1084. end
  1085. elseif poikkeus == nil then
  1086. if amount == 0 then q.Parent:BreakJoints() end
  1087. q.Health = q.Health - amount
  1088. showa(q)
  1089. end
  1090. end
  1091.  
  1092. if del ~= nil then
  1093. local find = v.Parent:FindFirstChild("hitted")
  1094. if find == nil then
  1095. dame(v)
  1096. val = Instance.new("BoolValue",v.Parent)val.Name="hitted"
  1097. game:GetService("Debris"):AddItem(val,del)
  1098. end
  1099. elseif del == nil then
  1100. dame(v)
  1101.  
  1102. end
  1103.  
  1104. end
  1105. end
  1106. end
  1107. -----------------------------------------------------------------
  1108.  
  1109. ------MESHIDS---
  1110. meshids = {["penguin"] = 15853464, ["ring"] = 3270017,
  1111. ["spike"] = 1033714,["cone"] = 1082802,["crown"] = 20329976,["crossbow"] = 15886761,
  1112. ["cloud"] = 1095708,["mjolnir"] = 1279013,["diamond"] = 9756362, ["hand"] = 37241605,
  1113. ["fist"] = 65322375,["skull"] = 36869983,["totem"] = 35624068,["spikeb"] = 9982590,["dragon"] = 58430372,["fish"] = 31221717, ["coffee"] = 15929962,["spiral"] = 1051557,
  1114. ["ramen"] = 19380188}---some meshids
  1115. textureids = {["cone"] = 1082804,["rainbow"] = 28488599,["fish"] = 31221733, ["coffee"] = 24181455,["monster"] = 33366441,["ramen"] = 19380153}
  1116. -----------------
  1117.  
  1118. ---MATH SHORTENINGS---
  1119. M = {["R"] = function(a,b) return math.random(a,b) end,
  1120. ["Cos"] = function(a) return math.cos(a) end,
  1121. ["Sin"] = function(a) return math.sin(a) end,
  1122. ["D"] = function(a) return math.rad(a) end
  1123. }
  1124.  
  1125. for i,v in pairs(char:GetChildren()) do
  1126. if v:IsA("Clothing") or v:IsA("Hat") then v:Remove()
  1127. end end
  1128.  
  1129. col = char:FindFirstChild("Body Colors")
  1130. if col == nil then col = Instance.new("BodyColors",char) end
  1131. collist = {
  1132. {'LeftLegColor',"Crimson"},
  1133. {'RightLegColor',"Crimson"},
  1134. {'TorsoColor',"Crimson"},
  1135. {'LeftArmColor',"Crimson"},
  1136. {'RightArmColor',"Crimson"},
  1137. }
  1138. for i,v in pairs(collist) do
  1139. col[v[1]] = BrickColor.new(v[2])
  1140. end
  1141. -------------------------------
  1142. shirt = Instance.new("Shirt", char)
  1143. shirt.Name = "Shirt"
  1144. pants = Instance.new("Pants", char)
  1145. pants.Name = "Pants"
  1146. char.Shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=279761704"
  1147. char.Pants.PantsTemplate = "http://www.roblox.com/asset/?id=279765514"
  1148. -------------------------------------
  1149. bracs = Instance.new("Model",m)
  1150. for i,v in pairs({rarm,larm}) do
  1151. for i,v in pairs(bracs:children()) do if v.Name ~= 'a' then v.Material = 'Ice' end end
  1152. end
  1153.  
  1154. --------MAKING--------------------
  1155. h1 = T.P(1.5,1.5,1.5,'Crimson',0,false,false)
  1156. h1.Material = "Granite"
  1157. T.FM(h1,'sphere',1,1,1)
  1158. T.W(h1,char.Head,0,0,0,0,0,0)
  1159.  
  1160. e1 = T.P(.5,.5,.5,'White',0,false,false) T.FM(e1,'sphere',1,1,1)
  1161. e1.Material = "Granite"
  1162. e2 = T.P(.5,.5,.5,'White',0,false,false) T.FM(e2,'sphere',1,1,1)
  1163. e2.Material = "Granite"
  1164. e1w=T.W(e1,h1,.35,0,-.55,0,0,0) T.W(e2,h1,-.35,0,-.55,0,0,0)
  1165. e1w.Material = "Granite"
  1166.  
  1167. dec = Instance.new("Decal")
  1168. dec.Face = 'Front'
  1169. dec.Texture = "http://www.roblox.com/asset/?id=0"
  1170.  
  1171.  
  1172.  
  1173. char.Head.Transparency = 1
  1174. -----------------------------------
  1175.  
  1176. function colorslide(obj,prop,scol,ecol,timme,override)
  1177. if scol == 'cur' then scol3 = obj.BrickColor.Color else
  1178. scol3 = BrickColor.new(scol).Color
  1179. end
  1180. ecol3 = BrickColor.new(ecol).Color
  1181.  
  1182. for i = 0,1,timme do
  1183. wait()
  1184. pos = v3n(scol3.r,scol3.g,scol3.b):Lerp(v3n(ecol3.r,ecol3.g,ecol3.b),i)
  1185. obj[prop] = Color3.new(pos.x,pos.y,pos.z)
  1186. end
  1187.  
  1188. end
  1189.  
  1190. function checkplayers(pos,radius,what)
  1191. tab = {}
  1192. for i,v in pairs(Workspace:GetChildren()) do
  1193. if v:IsA("Model") and v ~= char then
  1194. for _,q in pairs(v:GetChildren()) do
  1195. if q:IsA("Humanoid") then
  1196. if (q.Torso.Position-pos).magnitude <= radius then
  1197. if what == 'char' then table.insert(tab,q.Parent)
  1198. elseif what == 'humanoid' then table.insert(tab,q)
  1199. end
  1200. end end end end end
  1201. return tab
  1202. end
  1203.  
  1204. function rage()
  1205. tyu = cfn(0,.2,-.5)
  1206. lock.R(1) lock.L(1)
  1207. neck.C0 = normposn
  1208. for i = 0,140,10 do
  1209. wait()
  1210. rw.C1 = (normposr*tyu)*ang(M.D(i),0,M.D(i/(140/-50)))
  1211. lw.C1 = (normposl*tyu)*ang(M.D(i),0,M.D(i/(140/50)))
  1212. neck.C0 = normposn*ang(M.D(i/(140/30)),0,0)
  1213. end
  1214.  
  1215. wait(1)
  1216.  
  1217. for i = 140,50,-20 do
  1218. wait()
  1219. rw.C1 = (normposr)*ang(M.D(-i),0,M.D(i))
  1220. lw.C1 = (normposl)*ang(M.D(-i),0,M.D(-i))
  1221. end
  1222. neck.C0 = normposn*ang(M.D(-30),0,0)
  1223.  
  1224. fire = T.F(torso,30,30,'Bright red','Magenta')
  1225.  
  1226. ef = T.P(1,1,1,'Really red',0,false,false)
  1227. ew = T.W(ef,torso,0,0,0,0,0,0,ef)
  1228. msh = T.FM(ef,'sphere',1,1,1)
  1229. for i = 0,20 do wait() ef.Transparency = i/20 msh.Scale = v3n(i,i,i)
  1230. T.C(function()
  1231. tabb = checkplayers(ef.Position,20,'char')
  1232. if #tabb > 0 then
  1233. for i,v in pairs(tabb) do damage(v,10,true,.2) end
  1234. end
  1235. end)
  1236. end
  1237. msh:Remove()
  1238.  
  1239. for i = 30,8,-1 do
  1240. wait() fire.Size = i
  1241. end
  1242. colorslide(fire,'Color','Bright red','Deep blue',.05)
  1243.  
  1244. lock.R(0) lock.L(0) neck.C0 = normposn
  1245.  
  1246. end
  1247.  
  1248. hop = Instance.new("HopperBin",ply.Backpack)
  1249. hop.Name = name
  1250.  
  1251. holdpos = normposr*ang(math.pi/2,0,0)
  1252. port,port2,bol,boltime = nil,nil,false,1
  1253.  
  1254. function hide()
  1255. if char.Parent ~= curcam then
  1256. char.Parent = curcam
  1257. hop.Name = name..'(h)'
  1258. else char.Parent = Workspace
  1259. hop.Name = name
  1260. end
  1261. end
  1262.  
  1263. function makeport1()
  1264. if not port then --- Blue portal
  1265. circle()
  1266. port = Instance.new("Model",Workspace)
  1267. port.Name = 'omakotikullankallis'
  1268. ring = T.P(1,1,1,'Deep blue',0,false,true,port) T.FM(ring,'ring',4,4,1)
  1269. ring.CFrame = torso.CFrame * cfn(0,0,-4)
  1270. mir = T.P(3.5,.1,3.5,ring.BrickColor.Name,.5,false,true,port) T.FM(mir,'cylinder',1,1,1)
  1271. mir.CFrame = ring.CFrame*ang(math.pi/2,0,0)
  1272. mir.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid")
  1273. if hum ~= nil and hum.Parent == char and port2 and not bol then bol = true
  1274. hit.Parent:MoveTo(mir2.Position) wait(boltime) bol = false
  1275. end end) ---- On touch event for blue portal
  1276.  
  1277. elseif port then ring.CFrame = torso.CFrame * cfn(0,0,-4)
  1278. mir.CFrame = ring.CFrame*ang(math.pi/2,0,0)
  1279.  
  1280. end
  1281. end
  1282.  
  1283. function makeport2()
  1284. if not port2 then
  1285. circle()
  1286. port2 = Instance.new("Model",Workspace)
  1287. port2.Name = 'omakotikullankallis'
  1288. ring2 = T.P(1,1,1,'Neon orange',0,false,true,port2) T.FM(ring2,'ring',4,4,1)
  1289. ring2.CFrame = torso.CFrame * cfn(0,0,-4)
  1290. mir2 = T.P(3.5,.1,3.5,ring2.BrickColor.Name,.5,false,true,port2) T.FM(mir2,'cylinder',1,1,1)
  1291. mir2.CFrame = ring2.CFrame*ang(math.pi/2,0,0)
  1292.  
  1293. mir2.Touched:connect(function(hit) local hum = hit.Parent:FindFirstChild("Humanoid")
  1294. if hum ~= nil and hum.Parent == char and port and not bol then bol = true
  1295. hit.Parent:MoveTo(mir.Position) wait(boltime) bol = false
  1296. end end) ---- On touch event for orange portal
  1297.  
  1298. elseif port2 then ring2.CFrame = torso.CFrame * cfn(0,0,-4)
  1299. mir2.CFrame = ring2.CFrame*ang(math.pi/2,0,0)
  1300. end
  1301. end
  1302. holdpos2 = normposl*ang(math.pi/2,0,0)
  1303. function punch()
  1304. fires = {}
  1305. lock.R(1) lock.L(1)
  1306. for i,v in pairs(bracs:children()) do
  1307. if v.Name ~= 'a' then table.insert(fires,T.F(v,.5,.5,'White','Black')) end
  1308. end
  1309. sticks = Instance.new("Model",m)
  1310.  
  1311. rr = .5
  1312. for _,v in pairs({rarm,larm}) do
  1313. for _,pos in pairs({ {0,-rr}, {0,rr}, {rr,0}, {-rr,0} }) do
  1314. stick = T.P(.3,.3,2.5,'Really blue',.5,false,false,sticks)
  1315. stick.Touched:connect(function(hit) damage(hit.Parent,10000,true,.05) end)
  1316. T.W(stick,v,pos[1],-.6,pos[2],-math.pi/2,0,0)
  1317. end end
  1318. for i = 1,10 do
  1319. rw.C1 = holdpos*cfn(0,.5,0)
  1320. lw.C1 = (holdpos2*cfn(0,-.5,0))*ang(0,0,M.D(30))
  1321. wait(.05)
  1322. rw.C1 = (holdpos*cfn(0,-.5,0))*ang(0,0,M.D(-30))
  1323. lw.C1 = holdpos2*cfn(0,.5,0)
  1324. wait(.05)
  1325. end
  1326. sticks:Remove() for _,v in pairs(fires) do v:Remove() end
  1327. lock.R(0) lock.L(0)
  1328. end
  1329.  
  1330. Workspace.ChildRemoved:connect(function(child)
  1331. if child == port then port = nil
  1332. elseif child == port2 then port2 = nil
  1333. end end)
  1334.  
  1335. function removeports()
  1336. if port then port:Remove() port = nil end
  1337. if port2 then port2:Remove() port2 = nil end
  1338. for i,v in pairs(Workspace:GetChildren()) do if v.Name == 'omakotikullankallis' then v:Remove() end end
  1339. end
  1340.  
  1341. function circle()
  1342. r = .5
  1343. lock.R(1)
  1344. for i = 0,90,10 do wait() rw.C1 = normposr*ang(M.D(i),0,0) end
  1345.  
  1346. for i = 0,360,25 do
  1347. wait()
  1348. rw.C1 = holdpos*ang(M.Cos(M.D(-i))*r,0,M.Sin(M.D(-i))*r)
  1349. end
  1350.  
  1351. for i = 90,0,-10 do wait() rw.C1 = normposr*ang(M.D(i),0,0) end
  1352. lock.R(0)
  1353.  
  1354. end
  1355. Workspace.ChildRemoved:connect(function(child) if child == port then port = nil elseif child == port2 then port2 = nil end end) --- Nill's portals if they dont exist
  1356.  
  1357. function bowl(mouse)
  1358. colorslide(e1,'Color','cur','Royal purple',.05)
  1359. dec.Parent = e1
  1360. light = T.P(1,2,1,'Royal purple',.8,false,false)
  1361. light.Touched:connect(function(hit) damage(hit.Parent,10000,false,1) end)
  1362. T.FM(light,'spike',.5,2,.5)
  1363. T.W(light,e1,0,0,-1,math.pi/2,0,0)
  1364. holding = true
  1365. posa = e1.Position
  1366. while holding do
  1367. wait()
  1368.  
  1369. lv = char.Head.CFrame.lookVector
  1370. pos3 = ((posa-mouse.hit.p).unit):Cross(lv)
  1371. e1w.C1 = cfn(.35,0,-.55)*ang(0,pos3.Y,0)
  1372. end
  1373. light:Remove()
  1374. colorslide(e1,'Color','cur','Really black',.05) e1w.C1 = cfn(.35,0,-.55)
  1375. dec.Parent = nil
  1376. end
  1377.  
  1378. sitbp = nil
  1379. function sit()
  1380. if sitbp == nil then
  1381. lock.R(2) lock.L(2)
  1382. sitbp = T.BP(torso,torso.Position)
  1383. for i = 1,90,5 do
  1384. wait()
  1385. rhw.C1 = normposr2*ang(M.D(i),0,M.D(i/(90/-30)))
  1386. lhw.C1 = normposl2*ang(M.D(i),0,M.D(i/(90/30)))
  1387. sitbp.position = torso.Position - v3n(0,i/(90),0)
  1388. end
  1389. elseif sitbp ~= nil then
  1390. for i = 90,1,-5 do
  1391. wait()
  1392. rhw.C1 = normposr2*ang(M.D(i),0,M.D(i/(90/-30)))
  1393. lhw.C1 = normposl2*ang(M.D(i),0,M.D(i/(90/30)))
  1394. sitbp.position = torso.Position + v3n(0,i/(90),0)
  1395. end
  1396. lock.R(-1) lock.L(-1)
  1397. sitbp:Remove() sitbp = nil
  1398. end
  1399. end
  1400.  
  1401. function freemyself()
  1402. for i,v in pairs(char:GetChildren()) do
  1403. for _,o in pairs(v:GetChildren()) do
  1404. for _,q in pairs({'BodyPosition','BodyForce','BodyVelocity','BodyGyro'}) do
  1405. if o:IsA(q) then o:Remove() end
  1406. end
  1407. if o:IsA("Part") then
  1408. o.Anchored = false end
  1409. end
  1410. end
  1411. sk = T.P(1,1,1,'Royal Purple',0,false,false)
  1412. T.W(sk,torso,0,0,0,0,0,0,sk)
  1413. msh = T.FM(sk,'skull',3,3,3)
  1414. for i = 0,1,.05 do wait() sk.Transparency = i end sk:Remove()
  1415. end
  1416.  
  1417. function breake()
  1418. welds = {}
  1419. bps = {}
  1420. possa = torso.Position
  1421. for i,v in pairs(torso:children()) do
  1422. if v:IsA("Motor6D") then table.insert(welds,v) v.Parent = nil
  1423. end
  1424. end
  1425.  
  1426. for _,v in pairs(char:children()) do
  1427. if v:IsA("BasePart") then v.CanCollide = true end
  1428. end
  1429.  
  1430. local hum = char.Humanoid
  1431. hum.Parent = nil
  1432.  
  1433. holding = true
  1434.  
  1435. while holding do wait() end
  1436.  
  1437. for i,v in pairs(welds) do
  1438. v.Parent = torso
  1439. v.Part1 = v.Part1
  1440. end
  1441. hum.Parent = char
  1442. end
  1443.  
  1444. klist = {
  1445. {'fa',function() rage() end},
  1446. {'qa',function() makeport1() end},
  1447. {'ea',function() makeport2() end},
  1448. {'ra',function() removeports() end},
  1449. {'ca',function(a) punch(a) end},
  1450. {'xa',function() sit() end},
  1451. {'za',function() freemyself() end},
  1452. {'va',function() hide() end},
  1453. {'ga',function() breake() end,''}
  1454. }
  1455.  
  1456. hop.Deselected:connect(function() lock.R(0) lock.L(0) end)
  1457. hop.Selected:connect(function(mouse)
  1458. mouse.Button1Up:connect(function() holding = false end)
  1459. mouse.KeyUp:connect(function(a) for i,v in pairs(klist) do if a == v[1] and v[3] ~= nil then holding = false end end end)
  1460. mouse.KeyDown:connect(function(key) if attacking then return end
  1461. for i,v in pairs(klist) do
  1462. if key == v[1] then attacking = true v[2](mouse) attacking = false end
  1463. end
  1464. end)
  1465.  
  1466. mouse.Button1Down:connect(function() if attacking then return end attacking = true bowl(mouse) attacking = false end)
  1467. end)
Add Comment
Please, Sign In to add comment