Guest User

Untitled

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