Hugo1234cool

Untitled

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