Advertisement
00fjg

Untitled

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