Void_scripter0

Zombie 2

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