Advertisement
1x11337

Real Zombie

Jul 6th, 2018
345
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -----------------------------------
  2.  
  3. --Made by goodguyaiden-------------
  4. --Zombie---------------------------
  5. --its going to need to take a sec--
  6.  
  7. -----------------------------------
  8.  
  9. Char= game.Players.LocalPlayer.Character
  10.  
  11. Part0 = Instance.new("Part")
  12. Script1 = Instance.new("Script")
  13. Part2 = Instance.new("Part")
  14. Script3 = Instance.new("Script")
  15. Part0.Name = "zarm2"
  16. Part0.Parent = Char
  17. Part0.BrickColor = BrickColor.new("Medium green")
  18. Part0.Rotation = Vector3.new(0, -90, 0)
  19. Part0.RotVelocity = Vector3.new(4.07127958e-25, 3.33696291e-22, 6.94702468e-25)
  20. Part0.Velocity = Vector3.new(3.66463371e-20, 0.00686328812, 3.69331555e-20)
  21. Part0.FormFactor = Enum.FormFactor.Symmetric
  22. Part0.Size = Vector3.new(2, 1, 1)
  23. Part0.CFrame = CFrame.new(-22.1300011, 3.49999905, 24.6800003, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  24. Part0.BottomSurface = Enum.SurfaceType.Smooth
  25. Part0.TopSurface = Enum.SurfaceType.Smooth
  26. Part0.Color = Color3.new(0.631373, 0.768628, 0.54902)
  27. Part0.Position = Vector3.new(-22.1300011, 3.49999905, 24.6800003)
  28. Part0.Orientation = Vector3.new(0, -90, 0)
  29. Part0.Color = Color3.new(0.631373, 0.768628, 0.54902)
  30. Script1.Parent = Part0
  31.  
  32.  
  33. Part2.Name = "zarm"
  34. Part2.Parent = Char
  35. Part2.BrickColor = BrickColor.new("Medium green")
  36. Part2.Rotation = Vector3.new(0, -90, 0)
  37. Part2.RotVelocity = Vector3.new(4.07127958e-25, 3.33696291e-22, 6.94702468e-25)
  38. Part2.Velocity = Vector3.new(3.66463371e-20, 0.00686328812, 3.59320666e-20)
  39. Part2.FormFactor = Enum.FormFactor.Symmetric
  40. Part2.Size = Vector3.new(2, 1, 1)
  41. Part2.CFrame = CFrame.new(-19.1300011, 3.49999905, 24.6800003, 0, 0, -1, 0, 1, 0, 1, 0, 0)
  42. Part2.BottomSurface = Enum.SurfaceType.Smooth
  43. Part2.TopSurface = Enum.SurfaceType.Smooth
  44. Part2.Color = Color3.new(0.631373, 0.768628, 0.54902)
  45. Part2.Position = Vector3.new(-19.1300011, 3.49999905, 24.6800003)
  46. Part2.Orientation = Vector3.new(0, -90, 0)
  47. Part2.Color = Color3.new(0.631373, 0.768628, 0.54902)
  48. Script3.Parent = Part2
  49.  
  50.  
  51. local parts = Char:GetChildren()
  52. for i,part in pairs(parts)do
  53. if part.ClassName == "Part" or part.Name == "Head" or part.Name == "HumanoidRootPart" then
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. function OnTouched(part2)
  62. local humanoid = part2.Parent:FindFirstChild("Humanoid")
  63. if (humanoid ~= nil) then
  64.  
  65. humanoid.Health = humanoid.Health - 0.05
  66. humanoid.AutoRotate = true
  67. humanoid.Sit = true
  68.  
  69.  
  70.  
  71. end
  72. end
  73.  
  74. part.Touched:connect(OnTouched)
  75.  
  76.  
  77.  
  78.  
  79. wait(1)
  80. owner=game.Players.LocalPlayer.Name
  81.  
  82. function onTouched(part23)
  83. if part23.Parent ~= nil then
  84. local h = part23.Parent:findFirstChild("Humanoid")
  85. if h~=nil then
  86. if cantouch~=0 then
  87. if h.Parent.Name~=owner then
  88.  
  89. if h.Parent:findFirstChild("zarm")~=nil then return end
  90.  
  91. cantouch=0
  92.  
  93. local larm=h.Parent:findFirstChild("Left Arm")
  94. local rarm=h.Parent:findFirstChild("Right Arm")
  95.  
  96. if larm~=nil then
  97. larm:remove()
  98. end
  99. if rarm~=nil then
  100. rarm:remove()
  101. end
  102. local zee= Char:FindFirstChild("zarm2")
  103. if zee~=nil then
  104. local zlarm=zee:clone()
  105. local zrarm=zee:clone()
  106. if zlarm~=nil then
  107.  
  108. local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  109. zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
  110. zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
  111. zlarm.Parent=h.Parent
  112. zrarm.Parent=h.Parent
  113. zlarm:makeJoints()
  114. zrarm:makeJoints()
  115. zlarm.Anchored=false
  116. zrarm.Anchored=false
  117. wait(0.1)
  118. h.Parent.Head.Color=zee.Color
  119. else print("no zee"); return end
  120. end
  121. wait(1)
  122. cantouch=1
  123. end
  124. end
  125. end
  126. end
  127. end
  128.  
  129. part.Touched:connect(onTouched)
  130.  
  131.  
  132. wait(1)
  133. owner=game.Players.LocalPlayer.Name
  134.  
  135. function onTouched2(part3)
  136. if part3.Parent ~= nil then
  137. local h = part3.Parent:findFirstChild("Humanoid")
  138. if h~=nil then
  139. if cantouch~=0 then
  140. if h.Parent.Name~=owner then
  141.  
  142. if h.Parent:findFirstChild("zarm")~=nil then return end
  143.  
  144. cantouch=0
  145.  
  146. local larm=h.Parent:findFirstChild("Left Arm")
  147. local rarm=h.Parent:findFirstChild("Right Arm")
  148.  
  149. if larm~=nil then
  150. larm:remove()
  151. end
  152. if rarm~=nil then
  153. rarm:remove()
  154. end
  155. local zee= Char:FindFirstChild("zarm")
  156. if zee~=nil then
  157. local zlarm=zee:clone()
  158. local zrarm=zee:clone()
  159. if zlarm~=nil then
  160.  
  161. local rot=CFrame.new(0, 0, 0, 0, 0, 1, 0, 1, 0, -1, 0, 0)
  162. zlarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(-1.5,0.5,-0.5)) * rot
  163. zrarm.CFrame=h.Parent.Torso.CFrame * CFrame.new(Vector3.new(1.5,0.5,-0.5)) * rot
  164. zlarm.Parent=h.Parent
  165. zrarm.Parent=h.Parent
  166. zlarm:makeJoints()
  167. zrarm:makeJoints()
  168. zlarm.Anchored=false
  169. zrarm.Anchored=false
  170. wait(0.1)
  171. h.Parent.Head.Color=zee.Color
  172. else print("no zee"); return end
  173. end
  174. wait(1)
  175. cantouch=1
  176. end
  177. end
  178. end
  179. end
  180. end
  181.  
  182. part.Touched:connect(onTouched2)
  183.  
  184.  
  185. end
  186. end
  187. wait(0.2)
  188. plr = game.Players.LocalPlayer
  189. repeat wait() until plr.Character
  190. char = plr.Character
  191. local mouse = plr:GetMouse()
  192. local Player = game:service'Players'.localPlayer
  193. local chara = Player.Character
  194. Player=game:GetService("Players").LocalPlayer
  195. Character=Player.Character
  196. PlayerGui=Player.PlayerGui
  197. Backpack=Player.Backpack
  198. Torso=Character.Torso
  199. Head=Character.Head
  200. Humanoid=Character.Humanoid
  201. m=Instance.new('Model',Character)
  202. LeftArm=Character["Left Arm"]
  203. LeftLeg=Character["Left Leg"]
  204. RightArm=Character["Right Arm"]
  205. RightLeg=Character["Right Leg"]
  206. LS=Torso["Left Shoulder"]
  207. LH=Torso["Left Hip"]
  208. RS=Torso["Right Shoulder"]
  209. RH=Torso["Right Hip"]
  210. Face = Head.face
  211. Neck=Torso.Neck
  212. it=Instance.new
  213. attacktype=1
  214. vt=Vector3.new
  215. cf=CFrame.new
  216. cl3=Color3.new
  217. rgb=Color3.fromRGB
  218. bcn=BrickColor.new
  219. euler=CFrame.fromEulerAnglesXYZ
  220. angles=CFrame.Angles
  221. Humanoid.WalkSpeed = 41
  222. Player = game:GetService("Players").LocalPlayer
  223. PlayerGui = Player.PlayerGui
  224. Cam = workspace.CurrentCamera
  225. Backpack = Player.Backpack
  226. Character = Player.Character
  227. Humanoid = Character.Humanoid
  228. Mouse = Player:GetMouse()
  229. RootPart = Character["HumanoidRootPart"]
  230. Torso = Character["Torso"]
  231. Head = Character["Head"]
  232. RightArm = Character["Right Arm"]
  233. LeftArm = Character["Left Arm"]
  234. RightLeg = Character["Right Leg"]
  235. LeftLeg = Character["Left Leg"]
  236. RootJoint = RootPart["RootJoint"]
  237. Neck = Torso["Neck"]
  238. RightShoulder = Torso["Right Shoulder"]
  239. LeftShoulder = Torso["Left Shoulder"]
  240. RightHip = Torso["Right Hip"]
  241. LeftHip = Torso["Left Hip"]
  242. Sound0 = Instance.new("Sound")
  243. Sound0.Volume = 25
  244. Sound0.Parent = game.Players.LocalPlayer.Character.Head
  245. Sound0.SoundId = "rbxassetid://27697743"
  246. Sound0.Looped = true
  247. Sound0:Play()
  248. IT = Instance.new
  249. CF = CFrame.new
  250. VT = Vector3.new
  251. RAD = math.rad
  252. C3 = Color3.new
  253. UD2 = UDim2.new
  254. BRICKC = BrickColor.new
  255. ANGLES = CFrame.Angles
  256. EULER = CFrame.fromEulerAnglesXYZ
  257. COS = math.cos
  258. ACOS = math.acos
  259. SIN = math.sin
  260. ASIN = math.asin
  261. ABS = math.abs
  262. MRANDOM = math.random
  263. FLOOR = math.floor
  264. Animation_Speed = 3
  265. Frame_Speed = 1 / 60 -- (1 / 30) OR (1 / 60)
  266. local Speed = 12
  267. local ROOTC0 = CF(0, 0, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  268. local NECKC0 = CF(0, 1, 0) * ANGLES(RAD(-90), RAD(0), RAD(180))
  269. local RIGHTSHOULDERC0 = CF(-0.5, 0, 0) * ANGLES(RAD(0), RAD(90), RAD(0))
  270. local LEFTSHOULDERC0 = CF(0.5, 0, 0) * ANGLES(RAD(0), RAD(-90), RAD(0))
  271. local DAMAGEMULTIPLIER = 1
  272. local ANIM = "Idle"
  273. local ATTACK = false
  274. local EQUIPPED = false
  275. local HOLD = false
  276. local COMBO = 1
  277. local Rooted = false
  278. local SINE = 0
  279. local KEYHOLD = false
  280. local CHANGE = 2 / Animation_Speed
  281. local WALKINGANIM = false
  282. local VALUE1 = false
  283. local VALUE2 = false
  284. local ROBLOXIDLEANIMATION = IT("Animation")
  285. ROBLOXIDLEANIMATION.Name = "Roblox Idle Animation"
  286. ROBLOXIDLEANIMATION.AnimationId = "http://www.roblox.com/asset/?id=180435571"
  287. --ROBLOXIDLEANIMATION.Parent = Humanoid
  288. local WEAPONGUI = IT("ScreenGui", PlayerGui)
  289. WEAPONGUI.Name = "Weapon GUI"
  290. local Weapon = IT("Model")
  291. Weapon.Name = "Adds"
  292. local Effects = IT("Folder", Weapon)
  293. Effects.Name = "Effects"
  294. local ANIMATOR = Humanoid.Animator
  295. local ANIMATE = Character.Animate
  296. local UNANCHOR = true
  297. local PLAYANIMS = true
  298. ArtificialHB = Instance.new("BindableEvent", script)
  299. ArtificialHB.Name = "ArtificialHB"
  300.  
  301. script:WaitForChild("ArtificialHB")
  302.  
  303. frame = Frame_Speed
  304. tf = 0
  305. allowframeloss = false
  306. tossremainder = false
  307. lastframe = tick()
  308. script.ArtificialHB:Fire()
  309.  
  310. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  311. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  312. end
  313.  
  314. function PositiveAngle(NUMBER)
  315. if NUMBER >= 0 then
  316. NUMBER = 0
  317. end
  318. return NUMBER
  319. end
  320.  
  321. function NegativeAngle(NUMBER)
  322. if NUMBER <= 0 then
  323. NUMBER = 0
  324. end
  325. return NUMBER
  326. end
  327.  
  328. function Swait(NUMBER)
  329. if NUMBER == 0 or NUMBER == nil then
  330. ArtificialHB.Event:wait()
  331. else
  332. for i = 1, NUMBER do
  333. ArtificialHB.Event:wait()
  334. end
  335. end
  336. end
  337.  
  338. function QuaternionFromCFrame(cf)
  339. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  340. local trace = m00 + m11 + m22
  341. if trace > 0 then
  342. local s = math.sqrt(1 + trace)
  343. local recip = 0.5 / s
  344. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  345. else
  346. local i = 0
  347. if m11 > m00 then
  348. i = 1
  349. end
  350. if m22 > (i == 0 and m00 or m11) then
  351. i = 2
  352. end
  353. if i == 0 then
  354. local s = math.sqrt(m00 - m11 - m22 + 1)
  355. local recip = 0.5 / s
  356. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  357. elseif i == 1 then
  358. local s = math.sqrt(m11 - m22 - m00 + 1)
  359. local recip = 0.5 / s
  360. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  361. elseif i == 2 then
  362. local s = math.sqrt(m22 - m00 - m11 + 1)
  363. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  364. end
  365. end
  366. end
  367.  
  368. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  369. local xs, ys, zs = x + x, y + y, z + z
  370. local wx, wy, wz = w * xs, w * ys, w * zs
  371. local xx = x * xs
  372. local xy = x * ys
  373. local xz = x * zs
  374. local yy = y * ys
  375. local yz = y * zs
  376. local zz = z * zs
  377. 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))
  378. end
  379.  
  380. function QuaternionSlerp(a, b, t)
  381. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  382. local startInterp, finishInterp;
  383. if cosTheta >= 0.0001 then
  384. if (1 - cosTheta) > 0.0001 then
  385. local theta = ACOS(cosTheta)
  386. local invSinTheta = 1 / SIN(theta)
  387. startInterp = SIN((1 - t) * theta) * invSinTheta
  388. finishInterp = SIN(t * theta) * invSinTheta
  389. else
  390. startInterp = 1 - t
  391. finishInterp = t
  392. end
  393. else
  394. if (1 + cosTheta) > 0.0001 then
  395. local theta = ACOS(-cosTheta)
  396. local invSinTheta = 1 / SIN(theta)
  397. startInterp = SIN((t - 1) * theta) * invSinTheta
  398. finishInterp = SIN(t * theta) * invSinTheta
  399. else
  400. startInterp = t - 1
  401. finishInterp = t
  402. end
  403. end
  404. 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
  405. end
  406.  
  407. function Clerp(a, b, t)
  408. local qa = {QuaternionFromCFrame(a)}
  409. local qb = {QuaternionFromCFrame(b)}
  410. local ax, ay, az = a.x, a.y, a.z
  411. local bx, by, bz = b.x, b.y, b.z
  412. local _t = 1 - t
  413. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  414. end
  415.  
  416. function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
  417. local frame = IT("Frame")
  418. frame.BackgroundTransparency = TRANSPARENCY
  419. frame.BorderSizePixel = BORDERSIZEPIXEL
  420. frame.Position = POSITION
  421. frame.Size = SIZE
  422. frame.BackgroundColor3 = COLOR
  423. frame.BorderColor3 = BORDERCOLOR
  424. frame.Name = NAME
  425. frame.Parent = PARENT
  426. return frame
  427. end
  428.  
  429. function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
  430. local label = IT("TextLabel")
  431. label.BackgroundTransparency = 1
  432. label.Size = UD2(1, 0, 1, 0)
  433. label.Position = UD2(0, 0, 0, 0)
  434. label.TextColor3 = TEXTCOLOR
  435. label.TextStrokeTransparency = STROKETRANSPARENCY
  436. label.TextTransparency = TRANSPARENCY
  437. label.FontSize = TEXTFONTSIZE
  438. label.Font = TEXTFONT
  439. label.BorderSizePixel = BORDERSIZEPIXEL
  440. label.TextScaled = false
  441. label.Text = TEXT
  442. label.Name = NAME
  443. label.Parent = PARENT
  444. return label
  445. end
  446.  
  447. m = game.Players.LocalPlayer
  448. char = m.Character
  449. local txt = Instance.new("BillboardGui", char)
  450. txt.Adornee = char.Head
  451. txt.Name = "_status"
  452. txt.Size = UDim2.new(2, 0, 1.2, 0)
  453. txt.StudsOffset = Vector3.new(-9, 8, 0)
  454. local text = Instance.new("TextLabel", txt)
  455. text.Size = UDim2.new(10, 0, 7, 0)
  456. text.FontSize = "Size24"
  457. text.TextScaled = true
  458. text.TextTransparency = 0
  459. text.BackgroundTransparency = 1
  460. text.TextTransparency = 0
  461. text.TextStrokeTransparency = 0
  462. text.Font = "Bodoni"
  463. text.TextStrokeColor3 = Color3.new(0, 0, 0)
  464. v = Instance.new("Part")
  465. v.Name = "ColorBrick"
  466. v.Parent = m.Character
  467. v.Anchored = true
  468. v.CanCollide = false
  469. v.BottomSurface = "Smooth"
  470. v.TopSurface = "Smooth"
  471. v.Size = Vector3.new(10, 5, 3)
  472. v.Transparency = 1
  473. v.CFrame = char.Torso.CFrame
  474. v.BrickColor = BrickColor.new("Really black")
  475. v.Transparency = 1
  476. v.Shape = "Block"
  477. spawn(function()
  478. local TweenService = game:GetService("TweenService")
  479. local Colours = {Color3.fromRGB(255,0,0),Color3.fromRGB(255,128,0),Color3.fromRGB(255,255,0),Color3.fromRGB(0,255,0),Color3.fromRGB(0,255,255),Color3.fromRGB(0,0,255),Color3.fromRGB(191,0,255),Color3.fromRGB(255,0,191)}
  480. local Int = 0
  481. while wait(0.5) do
  482. if Int == #Colours then Int = 0 end
  483. Int = Int+1
  484. TweenService:Create(text,TweenInfo.new(1),{TextColor3 = Colours[Int]}):Play()
  485. end
  486. end)
  487. text.Text = "The Final Zombie"
  488.  
  489. function NoOutlines(PART)
  490. PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
  491. end
  492.  
  493.  
  494. function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
  495. local NEWWELD = IT(TYPE)
  496. NEWWELD.Part0 = PART0
  497. NEWWELD.Part1 = PART1
  498. NEWWELD.C0 = C0
  499. NEWWELD.C1 = C1
  500. NEWWELD.Parent = PARENT
  501. return NEWWELD
  502. end
  503.  
  504. local S = IT("Sound")
  505.  
  506. function CreateSound(ID, PARENT, VOLUME, PITCH)
  507. local NEWSOUND = nil
  508. coroutine.resume(coroutine.create(function()
  509. NEWSOUND = S:Clone()
  510. NEWSOUND.Parent = PARENT
  511. NEWSOUND.Volume = VOLUME
  512. NEWSOUND.Pitch = PITCH
  513. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  514. Swait()
  515. NEWSOUND:play()
  516. game:GetService("Debris"):AddItem(NEWSOUND, 10)
  517. end))
  518. return NEWSOUND
  519. end
  520.  
  521. function CFrameFromTopBack(at, top, back)
  522. local right = top:Cross(back)
  523. return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  524. end
  525.  
  526. function CreateWave(SIZE,WAIT,CFRAME,DOESROT,ROT,COLOR,GROW)
  527. local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0))
  528. local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "20329976", "", SIZE, VT(0,0,-SIZE.X/8))
  529. wave.CFrame = CFRAME
  530. coroutine.resume(coroutine.create(function(PART)
  531. for i = 1, WAIT do
  532. Swait()
  533. mesh.Scale = mesh.Scale + GROW
  534. mesh.Offset = VT(0,0,-(mesh.Scale.X/8))
  535. if DOESROT == true then
  536. wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0)
  537. end
  538. wave.Transparency = wave.Transparency + (0.5/WAIT)
  539. if wave.Transparency > 0.99 then
  540. wave:remove()
  541. end
  542. end
  543. end))
  544. end
  545.  
  546. function CreateRing(SIZE,DOESROT,ROT,WAIT,CFRAME,COLOR,GROW)
  547. local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(0,0,0))
  548. local mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "559831844", "", SIZE, VT(0,0,0))
  549. wave.CFrame = CFRAME
  550. coroutine.resume(coroutine.create(function(PART)
  551. for i = 1, WAIT do
  552. Swait()
  553. mesh.Scale = mesh.Scale + GROW
  554. if DOESROT == true then
  555. wave.CFrame = wave.CFrame * CFrame.fromEulerAnglesXYZ(0,ROT,0)
  556. end
  557. wave.Transparency = wave.Transparency + (0.5/WAIT)
  558. if wave.Transparency > 0.99 then
  559. wave:remove()
  560. end
  561. end
  562. end))
  563. end
  564.  
  565. function MagicSphere(SIZE,WAIT,CFRAME,COLOR,GROW)
  566. local wave = CreatePart(3, Effects, "Neon", 0, 0, BRICKC(COLOR), "Effect", VT(1,1,1), true)
  567. local mesh = CreateMesh("SpecialMesh", wave, "Sphere", "", "", SIZE, VT(0,0,0))
  568. wave.CFrame = CFRAME
  569. coroutine.resume(coroutine.create(function(PART)
  570. for i = 1, WAIT do
  571. Swait()
  572. mesh.Scale = mesh.Scale + GROW
  573. wave.Transparency = wave.Transparency + (1/WAIT)
  574. if wave.Transparency > 0.99 then
  575. wave:remove()
  576. end
  577. end
  578. end))
  579. end
  580.  
  581. function Slice(KIND,SIZE,WAIT,CFRAME,COLOR,GROW)
  582. local wave = CreatePart(3, Effects, "Neon", 0, 0.5, BRICKC(COLOR), "Effect", VT(1,1,1), true)
  583. local mesh = nil
  584. if KIND == "Base" then
  585. mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "448386996", "", VT(0,SIZE/10,SIZE/10), VT(0,0,0))
  586. elseif KIND == "Thin" then
  587. mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662586858", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0))
  588. elseif KIND == "Round" then
  589. mesh = CreateMesh("SpecialMesh", wave, "FileMesh", "662585058", "", VT(SIZE/10,0,SIZE/10), VT(0,0,0))
  590. end
  591. wave.CFrame = CFRAME
  592. coroutine.resume(coroutine.create(function(PART)
  593. for i = 1, WAIT do
  594. Swait()
  595. mesh.Scale = mesh.Scale + GROW/10
  596. wave.Transparency = wave.Transparency + (0.5/WAIT)
  597. if wave.Transparency > 0.99 then
  598. wave:remove()
  599. end
  600. end
  601. end))
  602. end
  603.  
  604. function MakeForm(PART,TYPE)
  605. if TYPE == "Cyl" then
  606. local MSH = IT("CylinderMesh",PART)
  607. elseif TYPE == "Ball" then
  608. local MSH = IT("SpecialMesh",PART)
  609. MSH.MeshType = "Sphere"
  610. elseif TYPE == "Wedge" then
  611. local MSH = IT("SpecialMesh",PART)
  612. MSH.MeshType = "Wedge"
  613. end
  614. end
  615.  
  616.  
  617. function CheckTableForString(Table, String)
  618. for i, v in pairs(Table) do
  619. if string.find(string.lower(String), string.lower(v)) then
  620. return true
  621. end
  622. end
  623. return false
  624. end
  625.  
  626. function CheckIntangible(Hit)
  627. local ProjectileNames = {"Water", "Arrow", "Projectile", "Effect", "Rail", "Lightning", "Bullet"}
  628. if Hit and Hit.Parent then
  629. if ((not Hit.CanCollide or CheckTableForString(ProjectileNames, Hit.Name)) and not Hit.Parent:FindFirstChild("Humanoid")) then
  630. return true
  631. end
  632. end
  633. return false
  634. end
  635.  
  636. Debris = game:GetService("Debris")
  637.  
  638. function CastZapRay(StartPos, Vec, Length, Ignore, DelayIfHit)
  639. local Direction = CFrame.new(StartPos, Vec).lookVector
  640. local Ignore = ((type(Ignore) == "table" and Ignore) or {Ignore})
  641. local RayHit, RayPos, RayNormal = game:GetService("Workspace"):FindPartOnRayWithIgnoreList(Ray.new(StartPos, Direction * Length), Ignore)
  642. if RayHit and CheckIntangible(RayHit) then
  643. if DelayIfHit then
  644. wait()
  645. end
  646. RayHit, RayPos, RayNormal = CastZapRay((RayPos + (Vec * 0.01)), Vec, (Length - ((StartPos - RayPos).magnitude)), Ignore, DelayIfHit)
  647. end
  648. return RayHit, RayPos, RayNormal
  649. end
  650.  
  651. function turnto(position)
  652. RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
  653. end
  654.  
  655.  
  656.  
  657. game:GetService("RunService").Heartbeat:connect(function(s, p)
  658. tf = tf + s
  659. if tf >= frame then
  660. if allowframeloss then
  661. script.ArtificialHB:Fire()
  662. lastframe = tick()
  663. else
  664. for i = 1, math.floor(tf / frame) do
  665. script.ArtificialHB:Fire()
  666. end
  667. lastframe = tick()
  668. end
  669. if tossremainder then
  670. tf = 0
  671. else
  672. tf = tf - frame * math.floor(tf / frame)
  673. end
  674. end
  675. end)
  676. function Raycast(POSITION, DIRECTION, RANGE, IGNOREDECENDANTS)
  677. return workspace:FindPartOnRay(Ray.new(POSITION, DIRECTION.unit * RANGE), IGNOREDECENDANTS)
  678. end
  679.  
  680. function PositiveAngle(NUMBER)
  681. if NUMBER >= 0 then
  682. NUMBER = 0
  683. end
  684. return NUMBER
  685. end
  686.  
  687. function NegativeAngle(NUMBER)
  688. if NUMBER <= 0 then
  689. NUMBER = 0
  690. end
  691. return NUMBER
  692. end
  693.  
  694. function Swait(NUMBER)
  695. if NUMBER == 0 or NUMBER == nil then
  696. ArtificialHB.Event:wait()
  697. else
  698. for i = 1, NUMBER do
  699. ArtificialHB.Event:wait()
  700. end
  701. end
  702. end
  703.  
  704. function CreateMesh(MESH, PARENT, MESHTYPE, MESHID, TEXTUREID, SCALE, OFFSET)
  705. local NEWMESH = IT(MESH)
  706. if MESH == "SpecialMesh" then
  707. NEWMESH.MeshType = MESHTYPE
  708. if MESHID ~= "nil" and MESHID ~= "" then
  709. NEWMESH.MeshId = "http://www.roblox.com/asset/?id="..MESHID
  710. end
  711. if TEXTUREID ~= "nil" and TEXTUREID ~= "" then
  712. NEWMESH.TextureId = "http://www.roblox.com/asset/?id="..TEXTUREID
  713. end
  714. end
  715. NEWMESH.Offset = OFFSET or VT(0, 0, 0)
  716. NEWMESH.Scale = SCALE
  717. NEWMESH.Parent = PARENT
  718. return NEWMESH
  719. end
  720.  
  721. function CreatePart(FORMFACTOR, PARENT, MATERIAL, REFLECTANCE, TRANSPARENCY, BRICKCOLOR, NAME, SIZE, ANCHOR)
  722. local NEWPART = IT("Part")
  723. NEWPART.formFactor = FORMFACTOR
  724. NEWPART.Reflectance = REFLECTANCE
  725. NEWPART.Transparency = TRANSPARENCY
  726. NEWPART.CanCollide = false
  727. NEWPART.Locked = true
  728. NEWPART.Anchored = true
  729. if ANCHOR == false then
  730. NEWPART.Anchored = false
  731. end
  732. NEWPART.BrickColor = BRICKC(tostring(BRICKCOLOR))
  733. NEWPART.Name = NAME
  734. NEWPART.Size = SIZE
  735. NEWPART.Position = Torso.Position
  736. NEWPART.Material = MATERIAL
  737. NEWPART:BreakJoints()
  738. NEWPART.Parent = PARENT
  739. return NEWPART
  740. end
  741.  
  742. local function weldBetween(a, b)
  743. local weldd = Instance.new("ManualWeld")
  744. weldd.Part0 = a
  745. weldd.Part1 = b
  746. weldd.C0 = CFrame.new()
  747. weldd.C1 = b.CFrame:inverse() * a.CFrame
  748. weldd.Parent = a
  749. return weldd
  750. end
  751.  
  752.  
  753. function QuaternionFromCFrame(cf)
  754. local mx, my, mz, m00, m01, m02, m10, m11, m12, m20, m21, m22 = cf:components()
  755. local trace = m00 + m11 + m22
  756. if trace > 0 then
  757. local s = math.sqrt(1 + trace)
  758. local recip = 0.5 / s
  759. return (m21 - m12) * recip, (m02 - m20) * recip, (m10 - m01) * recip, s * 0.5
  760. else
  761. local i = 0
  762. if m11 > m00 then
  763. i = 1
  764. end
  765. if m22 > (i == 0 and m00 or m11) then
  766. i = 2
  767. end
  768. if i == 0 then
  769. local s = math.sqrt(m00 - m11 - m22 + 1)
  770. local recip = 0.5 / s
  771. return 0.5 * s, (m10 + m01) * recip, (m20 + m02) * recip, (m21 - m12) * recip
  772. elseif i == 1 then
  773. local s = math.sqrt(m11 - m22 - m00 + 1)
  774. local recip = 0.5 / s
  775. return (m01 + m10) * recip, 0.5 * s, (m21 + m12) * recip, (m02 - m20) * recip
  776. elseif i == 2 then
  777. local s = math.sqrt(m22 - m00 - m11 + 1)
  778. local recip = 0.5 / s return (m02 + m20) * recip, (m12 + m21) * recip, 0.5 * s, (m10 - m01) * recip
  779. end
  780. end
  781. end
  782.  
  783. function QuaternionToCFrame(px, py, pz, x, y, z, w)
  784. local xs, ys, zs = x + x, y + y, z + z
  785. local wx, wy, wz = w * xs, w * ys, w * zs
  786. local xx = x * xs
  787. local xy = x * ys
  788. local xz = x * zs
  789. local yy = y * ys
  790. local yz = y * zs
  791. local zz = z * zs
  792. 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))
  793. end
  794.  
  795. function QuaternionSlerp(a, b, t)
  796. local cosTheta = a[1] * b[1] + a[2] * b[2] + a[3] * b[3] + a[4] * b[4]
  797. local startInterp, finishInterp;
  798. if cosTheta >= 0.0001 then
  799. if (1 - cosTheta) > 0.0001 then
  800. local theta = ACOS(cosTheta)
  801. local invSinTheta = 1 / SIN(theta)
  802. startInterp = SIN((1 - t) * theta) * invSinTheta
  803. finishInterp = SIN(t * theta) * invSinTheta
  804. else
  805. startInterp = 1 - t
  806. finishInterp = t
  807. end
  808. else
  809. if (1 + cosTheta) > 0.0001 then
  810. local theta = ACOS(-cosTheta)
  811. local invSinTheta = 1 / SIN(theta)
  812. startInterp = SIN((t - 1) * theta) * invSinTheta
  813. finishInterp = SIN(t * theta) * invSinTheta
  814. else
  815. startInterp = t - 1
  816. finishInterp = t
  817. end
  818. end
  819. 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
  820. end
  821.  
  822. function Clerp(a, b, t)
  823. local qa = {QuaternionFromCFrame(a)}
  824. local qb = {QuaternionFromCFrame(b)}
  825. local ax, ay, az = a.x, a.y, a.z
  826. local bx, by, bz = b.x, b.y, b.z
  827. local _t = 1 - t
  828. return QuaternionToCFrame(_t * ax + t * bx, _t * ay + t * by, _t * az + t * bz, QuaternionSlerp(qa, qb, t))
  829. end
  830.  
  831. function CreateFrame(PARENT, TRANSPARENCY, BORDERSIZEPIXEL, POSITION, SIZE, COLOR, BORDERCOLOR, NAME)
  832. local frame = IT("Frame")
  833. frame.BackgroundTransparency = TRANSPARENCY
  834. frame.BorderSizePixel = BORDERSIZEPIXEL
  835. frame.Position = POSITION
  836. frame.Size = SIZE
  837. frame.BackgroundColor3 = COLOR
  838. frame.BorderColor3 = BORDERCOLOR
  839. frame.Name = NAME
  840. frame.Parent = PARENT
  841. return frame
  842. end
  843.  
  844. function CreateLabel(PARENT, TEXT, TEXTCOLOR, TEXTFONTSIZE, TEXTFONT, TRANSPARENCY, BORDERSIZEPIXEL, STROKETRANSPARENCY, NAME)
  845. local label = IT("TextLabel")
  846. label.BackgroundTransparency = 1
  847. label.Size = UD2(1, 0, 1, 0)
  848. label.Position = UD2(0, 0, 0, 0)
  849. label.TextColor3 = TEXTCOLOR
  850. label.TextStrokeTransparency = STROKETRANSPARENCY
  851. label.TextTransparency = TRANSPARENCY
  852. label.FontSize = TEXTFONTSIZE
  853. label.Font = TEXTFONT
  854. label.BorderSizePixel = BORDERSIZEPIXEL
  855. label.TextScaled = false
  856. label.Text = TEXT
  857. label.Name = NAME
  858. label.Parent = PARENT
  859. return label
  860. end
  861.  
  862. function NoOutlines(PART)
  863. PART.TopSurface, PART.BottomSurface, PART.LeftSurface, PART.RightSurface, PART.FrontSurface, PART.BackSurface = 10, 10, 10, 10, 10, 10
  864. end
  865.  
  866. function CreateWeldOrSnapOrMotor(TYPE, PARENT, PART0, PART1, C0, C1)
  867. local NEWWELD = IT(TYPE)
  868. NEWWELD.Part0 = PART0
  869. NEWWELD.Part1 = PART1
  870. NEWWELD.C0 = C0
  871. NEWWELD.C1 = C1
  872. NEWWELD.Parent = PARENT
  873. return NEWWELD
  874. end
  875.  
  876. local S = IT("Sound")
  877. function CreateSound(ID, PARENT, VOLUME, PITCH, DOESLOOP)
  878. local NEWSOUND = nil
  879. coroutine.resume(coroutine.create(function()
  880. NEWSOUND = S:Clone()
  881. NEWSOUND.Parent = PARENT
  882. NEWSOUND.Volume = VOLUME
  883. NEWSOUND.Pitch = PITCH
  884. NEWSOUND.SoundId = "http://www.roblox.com/asset/?id="..ID
  885. NEWSOUND:play()
  886. if DOESLOOP == true then
  887. NEWSOUND.Looped = true
  888. else
  889. repeat wait(1) until NEWSOUND.Playing == false
  890. NEWSOUND:remove()
  891. end
  892. end))
  893. return NEWSOUND
  894. end
  895.  
  896. function MakeForm(PART,TYPE)
  897. if TYPE == "Cyl" then
  898. local MSH = IT("CylinderMesh",PART)
  899. elseif TYPE == "Ball" then
  900. local MSH = IT("SpecialMesh",PART)
  901. MSH.MeshType = "Sphere"
  902. elseif TYPE == "Wedge" then
  903. local MSH = IT("SpecialMesh",PART)
  904. MSH.MeshType = "Wedge"
  905. end
  906. end
  907.  
  908. function CFrameFromTopBack(at, top, back)
  909. local right = top:Cross(back)
  910. return CF(at.x, at.y, at.z, right.x, top.x, back.x, right.y, top.y, back.y, right.z, top.z, back.z)
  911. end
  912.  
  913. function PuddleOfBlood(Position,MaxDrop,Model,MaxSize)
  914. local HITFLOOR, HITPOS, NORMAL = Raycast(Position, (CF(Position, Position + VT(0, -1, 0))).lookVector, MaxDrop, Model)
  915. if HITFLOOR ~= nil then
  916. if HITFLOOR.Parent ~= Weapon and HITFLOOR.Parent ~= Character then
  917. if HITFLOOR.Name == "BloodPuddle" then
  918. local DIST = (Position - HITFLOOR.Position).Magnitude
  919. if (HITFLOOR.Size.Z <= 5 and HITFLOOR.Size.Z < MaxSize) or (HITFLOOR.Size.Z > 5 and HITFLOOR.Size.Z < MaxSize and DIST < HITFLOOR.Size.Z/3) then
  920. HITFLOOR.Size = HITFLOOR.Size + VT(0.1,0,0.1)
  921. end
  922. else
  923. if HITFLOOR.Anchored == true then
  924. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(2,0,2))
  925. BLOOD.CFrame = CF(HITPOS,HITPOS+NORMAL)*ANGLES(RAD(90),RAD(0),RAD(0))
  926. MakeForm(BLOOD,"Cyl")
  927. coroutine.resume(coroutine.create(function()
  928. Swait(75)
  929. while true do
  930. Swait()
  931. BLOOD.Size = BLOOD.Size - VT(0.02,0,0.02)
  932. if BLOOD.Size.Z < 0.051 then
  933. BLOOD:remove()
  934. break
  935. end
  936. end
  937. end))
  938. end
  939. end
  940. end
  941. end
  942. end
  943.  
  944. function SprayBlood(POSITION,DIRECTION,BloodSize)
  945. local BLOOD = CreatePart(3, Effects, "Glass", 0, 0, "Maroon", "BloodPuddle", VT(0.3,0.3,0.3),false)
  946. BLOOD.CFrame = CF(POSITION)
  947. MakeForm(BLOOD,"Ball")
  948. local bv = Instance.new("BodyVelocity",BLOOD)
  949. bv.maxForce = Vector3.new(1e9, 1e9, 1e9)
  950. bv.velocity = CF(POSITION,DIRECTION+VT(MRANDOM(-3,3)/30,MRANDOM(-3,3)/30,MRANDOM(-3,3)/30)).lookVector*75
  951. bv.Name = "MOVE"
  952. Debris:AddItem(bv,0.05)
  953. coroutine.resume(coroutine.create(function()
  954. local HASTOUCHEDGROUND = false
  955. local HIT = BLOOD.Touched:Connect(function(hit)
  956. if hit.Anchored == true then
  957. HASTOUCHEDGROUND = true
  958. PuddleOfBlood(BLOOD.Position+VT(0,1,0),2,BLOOD,BloodSize)
  959. end
  960. end)
  961. wait(5)
  962. if HASTOUCHEDGROUND == false then
  963. BLOOD:remove()
  964. end
  965. end))
  966. end
  967.  
  968. Debris = game:GetService("Debris")
  969.  
  970. function CastProperRay(StartPos, EndPos, Distance, Ignore)
  971. local DIRECTION = CF(StartPos,EndPos).lookVector
  972. return Raycast(StartPos, DIRECTION, Distance, Ignore)
  973. end
  974.  
  975. function turnto(position)
  976. RootPart.CFrame=CFrame.new(RootPart.CFrame.p,VT(position.X,RootPart.Position.Y,position.Z)) * CFrame.new(0, 0, 0)
  977. end
  978.  
  979. function recurse(root,callback,i)
  980. i= i or 0
  981. for _,v in pairs(root:GetChildren()) do
  982. i = i + 1
  983. callback(i,v)
  984.  
  985. if #v:GetChildren() > 0 then
  986. i = recurse(v,callback,i)
  987. end
  988. end
  989.  
  990. return i
  991. end
  992.  
  993. function ragdollJoint(character, part0, part1, attachmentName, className, properties)
  994. attachmentName = attachmentName.."RigAttachment"
  995. local constraint = Instance.new(className.."Constraint")
  996. constraint.Attachment0 = part0:FindFirstChild(attachmentName)
  997. constraint.Attachment1 = part1:FindFirstChild(attachmentName)
  998. constraint.Name = "RagdollConstraint"..part1.Name
  999.  
  1000. for _,propertyData in next,properties or {} do
  1001. constraint[propertyData[1]] = propertyData[2]
  1002. end
  1003.  
  1004. constraint.Parent = character
  1005. end
  1006.  
  1007. function getAttachment0(character, attachmentName)
  1008. for _,child in next,character:GetChildren() do
  1009. local attachment = child:FindFirstChild(attachmentName)
  1010. if attachment then
  1011. return attachment
  1012. end
  1013. end
  1014. end
  1015.  
  1016. function R15Ragdoll(character)
  1017. recurse(character, function(_,v)
  1018. if v:IsA("Attachment") then
  1019. v.Axis = Vector3.new(0, 1, 0)
  1020. v.SecondaryAxis = Vector3.new(0, 0, 1)
  1021. v.Rotation = Vector3.new(0, 0, 0)
  1022. end
  1023. end)
  1024. for _,child in next,character:GetChildren() do
  1025. if child:IsA("Accoutrement") then
  1026. for _,part in next,child:GetChildren() do
  1027. if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
  1028. local attachment1 = part:FindFirstChildOfClass("Attachment")
  1029. local attachment0 = getAttachment0(character,attachment1.Name)
  1030. if attachment0 and attachment1 then
  1031. local constraint = Instance.new("HingeConstraint")
  1032. constraint.Attachment0 = attachment0
  1033. constraint.Attachment1 = attachment1
  1034. constraint.LimitsEnabled = true
  1035. constraint.UpperAngle = 0
  1036. constraint.LowerAngle = 0
  1037. constraint.Parent = character
  1038. end
  1039. elseif part.Name == "HumanoidRootPart" then
  1040. part:remove()
  1041. end
  1042. end
  1043. end
  1044. end
  1045.  
  1046. ragdollJoint(character,character.LowerTorso, character.UpperTorso, "Waist", "BallSocket", {
  1047. {"LimitsEnabled",true};
  1048. {"UpperAngle",5};
  1049. })
  1050. ragdollJoint(character,character.UpperTorso, character.Head, "Neck", "BallSocket", {
  1051. {"LimitsEnabled",true};
  1052. {"UpperAngle",15};
  1053. })
  1054.  
  1055. local handProperties = {
  1056. {"LimitsEnabled", true};
  1057. {"UpperAngle",0};
  1058. {"LowerAngle",0};
  1059. }
  1060. ragdollJoint(character,character.LeftLowerArm, character.LeftHand, "LeftWrist", "Hinge", handProperties)
  1061. ragdollJoint(character,character.RightLowerArm, character.RightHand, "RightWrist", "Hinge", handProperties)
  1062.  
  1063. local shinProperties = {
  1064. {"LimitsEnabled", true};
  1065. {"UpperAngle", 0};
  1066. {"LowerAngle", -75};
  1067. }
  1068. ragdollJoint(character,character.LeftUpperLeg, character.LeftLowerLeg, "LeftKnee", "Hinge", shinProperties)
  1069. ragdollJoint(character,character.RightUpperLeg, character.RightLowerLeg, "RightKnee", "Hinge", shinProperties)
  1070.  
  1071. local footProperties = {
  1072. {"LimitsEnabled", true};
  1073. {"UpperAngle", 15};
  1074. {"LowerAngle", -45};
  1075. }
  1076. ragdollJoint(character,character.LeftLowerLeg, character.LeftFoot, "LeftAnkle", "Hinge", footProperties)
  1077. ragdollJoint(character,character.RightLowerLeg, character.RightFoot, "RightAnkle", "Hinge", footProperties)
  1078.  
  1079. ragdollJoint(character,character.UpperTorso, character.LeftUpperArm, "LeftShoulder", "BallSocket")
  1080. ragdollJoint(character,character.LeftUpperArm, character.LeftLowerArm, "LeftElbow", "BallSocket")
  1081. ragdollJoint(character,character.UpperTorso, character.RightUpperArm, "RightShoulder", "BallSocket")
  1082. ragdollJoint(character,character.RightUpperArm, character.RightLowerArm, "RightElbow", "BallSocket")
  1083. ragdollJoint(character,character.LowerTorso, character.LeftUpperLeg, "LeftHip", "BallSocket")
  1084. ragdollJoint(character,character.LowerTorso, character.RightUpperLeg, "RightHip", "BallSocket")
  1085. end
  1086.  
  1087. function Ragdoll(Character2,CharTorso)
  1088. Character2:BreakJoints()
  1089. local hum = Character2:findFirstChild("Humanoid")
  1090. hum:remove()
  1091. local function Scan(ch)
  1092. local e
  1093. for e = 1,#ch do
  1094. Scan(ch[e]:GetChildren())
  1095. if ch[e].ClassName == "Weld" or ch[e].ClassName == "Motor6D" then
  1096. ch[e]:remove()
  1097. end
  1098. end
  1099. end
  1100. local NEWHUM = IT("Humanoid")
  1101. NEWHUM.Name = "Corpse"
  1102. NEWHUM.Health = 0
  1103. NEWHUM.MaxHealth = 0
  1104. NEWHUM.PlatformStand = true
  1105. NEWHUM.Parent = Character2
  1106. NEWHUM.DisplayDistanceType = "None"
  1107.  
  1108. local ch = Character2:GetChildren()
  1109. local i
  1110. for i = 1,#ch do
  1111. if ch[i].Name == "THandle1" or ch[i].Name == "THandle2" then
  1112. ch[i]:remove()
  1113. end
  1114. end
  1115.  
  1116. local Torso2 = Character2.Torso
  1117. local movevector = Vector3.new()
  1118.  
  1119. if Torso2 then
  1120. movevector = CFrame.new(CharTorso.Position,Torso2.Position).lookVector
  1121. local Head = Character2:FindFirstChild("Head")
  1122. if Head then
  1123. local Neck = Instance.new("Weld")
  1124. Neck.Name = "Neck"
  1125. Neck.Part0 = Torso2
  1126. Neck.Part1 = Head
  1127. Neck.C0 = CFrame.new(0, 1.5, 0)
  1128. Neck.C1 = CFrame.new()
  1129. Neck.Parent = Torso2
  1130.  
  1131. end
  1132. local Limb = Character2:FindFirstChild("Right Arm")
  1133. if Limb then
  1134.  
  1135. Limb.CFrame = Torso2.CFrame * CFrame.new(1.5, 0, 0)
  1136. local Joint = Instance.new("Glue")
  1137. Joint.Name = "RightShoulder"
  1138. Joint.Part0 = Torso2
  1139. Joint.Part1 = Limb
  1140. Joint.C0 = CFrame.new(1.5, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1141. Joint.C1 = CFrame.new(-0, 0.5, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1142. Joint.Parent = Torso2
  1143.  
  1144. local B = Instance.new("Part")
  1145. B.TopSurface = 0
  1146. B.BottomSurface = 0
  1147. B.formFactor = "Symmetric"
  1148. B.Size = Vector3.new(1, 1, 1)
  1149. B.Transparency = 1
  1150. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1151. B.Parent = Character2
  1152. local W = Instance.new("Weld")
  1153. W.Part0 = Limb
  1154. W.Part1 = B
  1155. W.C0 = CFrame.new(0, -0.5, 0)
  1156. W.Parent = Limb
  1157.  
  1158. end
  1159. local Limb = Character2:FindFirstChild("Left Arm")
  1160. if Limb then
  1161.  
  1162. Limb.CFrame = Torso2.CFrame * CFrame.new(-1.5, 0, 0)
  1163. local Joint = Instance.new("Glue")
  1164. Joint.Name = "LeftShoulder"
  1165. Joint.Part0 = Torso2
  1166. Joint.Part1 = Limb
  1167. Joint.C0 = CFrame.new(-1.5, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1168. Joint.C1 = CFrame.new(0, 0.5, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1169. Joint.Parent = Torso2
  1170.  
  1171. local B = Instance.new("Part")
  1172. B.TopSurface = 0
  1173. B.BottomSurface = 0
  1174. B.formFactor = "Symmetric"
  1175. B.Size = Vector3.new(1, 1, 1)
  1176. B.Transparency = 1
  1177. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1178. B.Parent = Character2
  1179. local W = Instance.new("Weld")
  1180. W.Part0 = Limb
  1181. W.Part1 = B
  1182. W.C0 = CFrame.new(0, -0.5, 0)
  1183. W.Parent = Limb
  1184.  
  1185. end
  1186. local Limb = Character2:FindFirstChild("Right Leg")
  1187. if Limb then
  1188.  
  1189. Limb.CFrame = Torso2.CFrame * CFrame.new(0.5, -2, 0)
  1190. local Joint = Instance.new("Glue")
  1191. Joint.Name = "RightHip"
  1192. Joint.Part0 = Torso2
  1193. Joint.Part1 = Limb
  1194. Joint.C0 = CFrame.new(0.5, -1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1195. Joint.C1 = CFrame.new(0, 1, 0, 0, 0, 1, 0, 1, 0, -1, -0, -0)
  1196. Joint.Parent = Torso2
  1197.  
  1198. local B = Instance.new("Part")
  1199. B.TopSurface = 0
  1200. B.BottomSurface = 0
  1201. B.formFactor = "Symmetric"
  1202. B.Size = Vector3.new(1, 1, 1)
  1203. B.Transparency = 1
  1204. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1205. B.Parent = Character2
  1206. local W = Instance.new("Weld")
  1207. W.Part0 = Limb
  1208. W.Part1 = B
  1209. W.C0 = CFrame.new(0, -0.5, 0)
  1210. W.Parent = Limb
  1211.  
  1212. end
  1213. local Limb = Character2:FindFirstChild("Left Leg")
  1214. if Limb then
  1215.  
  1216. Limb.CFrame = Torso2.CFrame * CFrame.new(-0.5, -2, 0)
  1217. local Joint = Instance.new("Glue")
  1218. Joint.Name = "LeftHip"
  1219. Joint.Part0 = Torso2
  1220. Joint.Part1 = Limb
  1221. Joint.C0 = CFrame.new(-0.5, -1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1222. Joint.C1 = CFrame.new(-0, 1, 0, -0, -0, -1, 0, 1, 0, 1, 0, 0)
  1223. Joint.Parent = Torso2
  1224.  
  1225. local B = Instance.new("Part")
  1226. B.TopSurface = 0
  1227. B.BottomSurface = 0
  1228. B.formFactor = "Symmetric"
  1229. B.Size = Vector3.new(1, 1, 1)
  1230. B.Transparency = 1
  1231. B.CFrame = Limb.CFrame * CFrame.new(0, -0.5, 0)
  1232. B.Parent = Character2
  1233. local W = Instance.new("Weld")
  1234. W.Part0 = Limb
  1235. W.Part1 = B
  1236. W.C0 = CFrame.new(0, -0.5, 0)
  1237. W.Parent = Limb
  1238.  
  1239. end
  1240. --[
  1241. local Bar = Instance.new("Part")
  1242. Bar.TopSurface = 0
  1243. Bar.BottomSurface = 0
  1244. Bar.formFactor = "Symmetric"
  1245. Bar.Size = Vector3.new(1, 1, 1)
  1246. Bar.Transparency = 1
  1247. Bar.CFrame = Torso2.CFrame * CFrame.new(0, 0.5, 0)
  1248. Bar.Parent = Character2
  1249. local Weld = Instance.new("Weld")
  1250. Weld.Part0 = Torso2
  1251. Weld.Part1 = Bar
  1252. Weld.C0 = CFrame.new(0, 0.5, 0)
  1253. Weld.Parent = Torso2
  1254. --]]
  1255. end
  1256. Character2.Parent = workspace
  1257. Debris:AddItem(Character2,5)
  1258.  
  1259. return Character2,Torso2
  1260. end
  1261.  
  1262. Character["Body Colors"].HeadColor = BrickColor.new("New Yeller")
  1263. Character["Body Colors"].TorsoColor = BrickColor.new("Bright blue")
  1264. Character["Body Colors"].LeftArmColor = BrickColor.new("New Yeller")
  1265. Character["Body Colors"].RightArmColor = BrickColor.new("New Yeller")
  1266. Character["Body Colors"].LeftLegColor = BrickColor.new("Bright blue")
  1267. Character["Body Colors"].RightLegColor = BrickColor.new("Bright blue")
  1268.  
  1269.  
  1270.  
  1271.  
  1272.  
  1273. function MouseUp(Mouse)
  1274. end
  1275.  
  1276. function KeyDown(Key)
  1277. end
  1278.  
  1279. function KeyUp(Key)
  1280. end
  1281.  
  1282. Mouse.Button1Down:connect(function(NEWKEY)
  1283. MouseDown(NEWKEY)
  1284. end)
  1285. Mouse.Button1Up:connect(function(NEWKEY)
  1286. MouseUp(NEWKEY)
  1287. end)
  1288. Mouse.KeyDown:connect(function(NEWKEY)
  1289. KeyDown(NEWKEY)
  1290. end)
  1291. Mouse.KeyUp:connect(function(NEWKEY)
  1292. KeyUp(NEWKEY)
  1293. end)
  1294.  
  1295.  
  1296. Humanoid.Changed:connect(function(Jump)
  1297. if Jump == "Jump" and (Disable_Jump == true) then
  1298. Humanoid.Jump = false
  1299. end
  1300. end)
  1301.  
  1302. while true do
  1303. Swait()
  1304. script.Parent = WEAPONGUI
  1305. ANIMATE.Parent = nil
  1306. for _,v in next, Humanoid:GetPlayingAnimationTracks() do
  1307. v:Stop();
  1308. end
  1309. SINE = SINE + CHANGE
  1310. local TORSOVELOCITY = (RootPart.Velocity * VT(1, 0, 1)).magnitude
  1311. local TORSOVERTICALVELOCITY = RootPart.Velocity.y
  1312. local HITFLOOR = Raycast(RootPart.Position, (CF(RootPart.Position, RootPart.Position + VT(0, -1, 0))).lookVector, 4, Character)
  1313. local WALKSPEEDVALUE = 6 / (Humanoid.WalkSpeed / 16)
  1314. if ANIM == "Walk" and TORSOVELOCITY > 1 then
  1315. RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, -0.15 * COS(SINE / (WALKSPEEDVALUE / 2))) * ANGLES(RAD(0), RAD(0) - RootPart.RotVelocity.Y / 75, RAD(0)), 2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1316. Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(2.5 * SIN(SINE / (WALKSPEEDVALUE / 2))), RAD(0), RAD(0) - Head.RotVelocity.Y / 30), 0.2 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1317. RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 0.875 - 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), -0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ 0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0) - RightLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1318. LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 0.875 + 0.125 * SIN(SINE / WALKSPEEDVALUE) - 0.15 * COS(SINE / WALKSPEEDVALUE*2), 0.125 * COS(SINE / WALKSPEEDVALUE) +0.2+ -0.2 * COS(SINE / WALKSPEEDVALUE)) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0) + LeftLeg.RotVelocity.Y / 75, RAD(0), RAD(76 * COS(SINE / WALKSPEEDVALUE))), 0.3 * (Humanoid.WalkSpeed / 16) / Animation_Speed)
  1319. elseif (ANIM ~= "Walk") or (TORSOVELOCITY < 1) then
  1320. RootJoint.C1 = Clerp(RootJoint.C1, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1321. Neck.C1 = Clerp(Neck.C1, CF(0, -0.5, 0) * ANGLES(RAD(-90), RAD(0), RAD(180)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1322. RightHip.C1 = Clerp(RightHip.C1, CF(0.5, 1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1323. LeftHip.C1 = Clerp(LeftHip.C1, CF(-0.5, 1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1324. end
  1325. if TORSOVERTICALVELOCITY > 1 and HITFLOOR == nil then
  1326. ANIM = "Jump"
  1327. if PLAYANIMS == true then
  1328. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1329. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0 + ((1) - 1)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1330. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(20)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
  1331. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-40), RAD(0), RAD(-20)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
  1332. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, -0.3) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(-20)), 0.2 / Animation_Speed)
  1333. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, -0.3) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(-5), RAD(0), RAD(20)), 0.2 / Animation_Speed)
  1334. end
  1335. elseif TORSOVERTICALVELOCITY < -1 and HITFLOOR == nil then
  1336. ANIM = "Fall"
  1337. if PLAYANIMS == true then
  1338. RootJoint.C0 = Clerp(RootJoint.C0, ROOTC0 * CF(0, 0, 0 ) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1339. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, -0.5 , 0 + ((1) - 1)) * ANGLES(RAD(-25), RAD(0), RAD(0)), 0.2 / Animation_Speed)
  1340. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(100), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.2 / Animation_Speed)
  1341. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-100), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.2 / Animation_Speed)
  1342. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0) * ANGLES(RAD(0), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(20)), 0.2 / Animation_Speed)
  1343. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0) * ANGLES(RAD(0), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(10)), 0.2 / Animation_Speed)
  1344. end
  1345. elseif TORSOVELOCITY < 1 and HITFLOOR ~= nil then
  1346. ANIM = "Idle"
  1347. if PLAYANIMS == true then
  1348. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(-20), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1349. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, -0, -0) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1350. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(-60), RAD(0), RAD(0)) * RIGHTSHOULDERC0, 0.15 / Animation_Speed)
  1351. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(-60), RAD(0), RAD(0)) * LEFTSHOULDERC0, 0.15 / Animation_Speed)
  1352. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(-20), RAD(90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1353. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1 - 0.05 * COS(SINE / 12), -0.01) * ANGLES(RAD(-20), RAD(-90), RAD(0)) * ANGLES(RAD(0), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1354. end
  1355. elseif TORSOVELOCITY > 1 and HITFLOOR ~= nil then
  1356. ANIM = "Walk"
  1357. if PLAYANIMS == true then
  1358. RootJoint.C0 = Clerp(RootJoint.C0,ROOTC0 * CF(0, 0, 0 + 0.05 * COS(SINE / 12)) * ANGLES(RAD(15), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1359. Neck.C0 = Clerp(Neck.C0, NECKC0 * CF(0, 0, 0) * ANGLES(RAD(-15), RAD(0), RAD(0)), 0.15 / Animation_Speed)
  1360. RightShoulder.C0 = Clerp(RightShoulder.C0, CF(1.5, 0.5, 0) * ANGLES(RAD(90), RAD(30), RAD(0)) * RIGHTSHOULDERC0, 0.35 / Animation_Speed)
  1361. LeftShoulder.C0 = Clerp(LeftShoulder.C0, CF(-1.5, 0.5, 0) * ANGLES(RAD(90), RAD(-30), RAD(0)) * LEFTSHOULDERC0, 0.35 / Animation_Speed)
  1362. RightHip.C0 = Clerp(RightHip.C0, CF(1, -1, 0.2) * ANGLES(RAD(50 * COS(SINE / WALKSPEEDVALUE)), RAD(90), RAD(0)), 1)
  1363. LeftHip.C0 = Clerp(LeftHip.C0, CF(-1, -1, 0.2) * ANGLES(RAD(-50 * COS(SINE / WALKSPEEDVALUE)), RAD(-90), RAD(0)), 1)
  1364. end
  1365. end
  1366. end
  1367. if Rooted == false then
  1368. Disable_Jump = false
  1369. Humanoid.WalkSpeed = Speed
  1370. elseif Rooted == true then
  1371. Disable_Jump = true
  1372. Humanoid.WalkSpeed = 0
  1373. end
  1374.  
  1375. Humanoid.Health = Humanoid.Health + 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement