Advertisement
wamandnj

Untitled

Oct 22nd, 2018
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- This script has been converted to FE by iPxter
  2.  
  3.  
  4. if game:GetService("RunService"):IsClient() then error("Script must be server-side in order to work; use h/ and not hl/") end
  5. local Player,Mouse,mouse,UserInputService,ContextActionService = owner
  6. do
  7. print("FE Compatibility code by Mokiros | Translated to FE by iPxter")
  8. script.Parent = Player.Character
  9.  
  10. --RemoteEvent for communicating
  11. local Event = Instance.new("RemoteEvent")
  12. Event.Name = "UserInput_Event"
  13.  
  14. --Fake event to make stuff like Mouse.KeyDown work
  15. local function fakeEvent()
  16. local t = {_fakeEvent=true,Connect=function(self,f)self.Function=f end}
  17. t.connect = t.Connect
  18. return t
  19. end
  20.  
  21. --Creating fake input objects with fake variables
  22. local m = {Target=nil,Hit=CFrame.new(),KeyUp=fakeEvent(),KeyDown=fakeEvent(),Button1Up=fakeEvent(),Button1Down=fakeEvent()}
  23. local UIS = {InputBegan=fakeEvent(),InputEnded=fakeEvent()}
  24. local CAS = {Actions={},BindAction=function(self,name,fun,touch,...)
  25. CAS.Actions[name] = fun and {Name=name,Function=fun,Keys={...}} or nil
  26. end}
  27. --Merged 2 functions into one by checking amount of arguments
  28. CAS.UnbindAction = CAS.BindAction
  29.  
  30. --This function will trigger the events that have been :Connect()'ed
  31. local function te(self,ev,...)
  32. local t = m[ev]
  33. if t and t._fakeEvent and t.Function then
  34. t.Function(...)
  35. end
  36. end
  37. m.TrigEvent = te
  38. UIS.TrigEvent = te
  39.  
  40. Event.OnServerEvent:Connect(function(plr,io)
  41. if plr~=Player then return end
  42. if io.isMouse then
  43. m.Target = io.Target
  44. m.Hit = io.Hit
  45. else
  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 UIS = game:GetService("UserInputService")
  66. local input = function(io,a)
  67. if a then return end
  68. --Since InputObject is a client-side instance, we create and pass table instead
  69. Event:FireServer({KeyCode=io.KeyCode,UserInputType=io.UserInputType,UserInputState=io.UserInputState})
  70. end
  71. UIS.InputBegan:Connect(input)
  72. UIS.InputEnded:Connect(input)
  73.  
  74. local Mouse = Player:GetMouse()
  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. Mouse,mouse,UserInputService,ContextActionService = m,m,UIS,CAS
  85. end
  86.  
  87. print([[
  88. ___________________________________
  89.  
  90. Booty Offender // A Kyutatsuki13's script
  91. Build 0001
  92. Credit to Ethanhong that gave me this idea ;)
  93. https://discord.gg/DueqyJ8
  94.  
  95. ___________________________________
  96. ]])
  97.  
  98. local p = owner
  99. local char = p.Character
  100. local larm = char:WaitForChild("Left Arm")
  101. local rarm = char:WaitForChild("Right Arm")
  102. local lleg = char:WaitForChild("Left Leg")
  103. local rleg = char:WaitForChild("Right Leg")
  104. local hed = char:WaitForChild("Head")
  105. local torso = char:WaitForChild("Torso")
  106. local root = char:WaitForChild("HumanoidRootPart")
  107. local hum = char:FindFirstChildOfClass("Humanoid")
  108. local debris = game:GetService("Debris")
  109. local input = game:GetService("UserInputService")
  110. local run = game:GetService("RunService")
  111. local rs = run.RenderStepped
  112. local wingpose = "Idle"
  113. local DebrisModel = Instance.new("Model",char)
  114. DebrisModel.Name = "Debris"
  115. repeat rs:wait() until p.CharacterAppearanceLoaded
  116.  
  117. noidle = false
  118. shift = false
  119. control = false
  120.  
  121. ----------------------------------------------------------------------------
  122.  
  123. function rswait(value)
  124. if value ~= nil and value ~= 0 then
  125. for i=1,value do
  126. rs:wait()
  127. end
  128. else
  129. rs:wait()
  130. end
  131. end
  132.  
  133. ----------------------------------------------------------------------------
  134.  
  135. local timeposition = 0
  136.  
  137. function music(id)
  138. if id == "Stop" then
  139. if not torso:FindFirstChild("MusicRuin") then
  140. soundz = Instance.new("Sound",torso)
  141. end
  142. soundz:Stop()
  143. else
  144. if not torso:FindFirstChild("MusicRuin") then
  145. soundz = Instance.new("Sound",torso)
  146. for i=1,2 do
  147. local equalizer = Instance.new("EqualizerSoundEffect",soundz)
  148. equalizer.HighGain = 6
  149. equalizer.MidGain = 0
  150. equalizer.LowGain = 6
  151. end
  152. end
  153. soundz.Volume = 10
  154. soundz.Name = "MusicRuin"
  155. soundz.Looped = true
  156. soundz.PlaybackSpeed = 1
  157. soundz.SoundId = "rbxassetid://"..id
  158. soundz:Stop()
  159. soundz:Play()
  160. end
  161. end
  162.  
  163. ----------------------------------------------------------------------------
  164.  
  165. function lerp(a, b, t)
  166. return a + (b - a)*t
  167. end
  168.  
  169. ----------------------------------------------------------------------------
  170.  
  171. function Lerp(c1,c2,al)
  172. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  173. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  174. for i,v in pairs(com1) do
  175. com1[i] = v+(com2[i]-v)*al
  176. end
  177. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  178. end
  179.  
  180. ----------------------------------------------------------------------------
  181.  
  182. function slerp(a, b, t)
  183. dot = a:Dot(b)
  184. if dot > 0.99999 or dot < -0.99999 then
  185. return t <= 0.5 and a or b
  186. else
  187. r = math.acos(dot)
  188. return (a*math.sin((1 - t)*r) + b*math.sin(t*r)) / math.sin(r)
  189. end
  190. end
  191.  
  192. ----------------------------------------------------------------------------
  193.  
  194. function clerp(c1,c2,al)
  195.  
  196. local com1 = {c1.X,c1.Y,c1.Z,c1:toEulerAnglesXYZ()}
  197.  
  198. local com2 = {c2.X,c2.Y,c2.Z,c2:toEulerAnglesXYZ()}
  199.  
  200. for i,v in pairs(com1) do
  201.  
  202. com1[i] = lerp(v,com2[i],al)
  203.  
  204. end
  205.  
  206. return CFrame.new(com1[1],com1[2],com1[3]) * CFrame.Angles(select(4,unpack(com1)))
  207.  
  208. end
  209.  
  210. ----------------------------------------------------------------------------
  211.  
  212. function findAllNearestTorso(pos,dist)
  213. local list = workspace:children()
  214. local torso = {}
  215. local temp = nil
  216. local human = nil
  217. local temp2 = nil
  218. for x = 1, #list do
  219. temp2 = list[x]
  220. if (temp2.className == "Model") and (temp2 ~= char) then
  221. temp = temp2:findFirstChild("Torso")
  222. human = temp2:findFirstChildOfClass("Humanoid")
  223. if (temp ~= nil) and (human ~= nil) and (human.Health > 0) then
  224. if (temp.Position - pos).magnitude < dist then
  225. table.insert(torso,temp)
  226. dist = (temp.Position - pos).magnitude
  227. end
  228. end
  229. end
  230. end
  231. return torso
  232. end
  233.  
  234. ----------------------------------------------------------------------------
  235.  
  236. function checkIfNotPlayer(model)
  237. if model.CanCollide == true and model ~= char and model.Parent ~= char and model.Parent.Parent ~= char and model.Parent.Parent ~= char and model.Parent ~= DebrisModel and model.Parent.Parent ~= DebrisModel and model.Parent.Parent.Parent ~= DebrisModel and model ~= wings and model.Parent ~= wings and model.Parent.Parent ~= wings then
  238. return true
  239. else
  240. return false
  241. end
  242. end
  243.  
  244. ----------------------------------------------------------------------------
  245.  
  246. function newWeld(wp0, wp1, wc0x, wc0y, wc0z)
  247.  
  248. local wld = Instance.new("Weld", wp1)
  249.  
  250. wld.Part0 = wp0
  251.  
  252. wld.Part1 = wp1
  253.  
  254. wld.C0 = CFrame.new(wc0x, wc0y, wc0z)
  255.  
  256. return wld
  257.  
  258. end
  259.  
  260. function weld(model)
  261. local parts,last = {}
  262. local function scan(parent)
  263. for _,v in pairs(parent:GetChildren()) do
  264. if (v:IsA("BasePart")) then
  265. if (last) then
  266. local w = Instance.new("Weld")
  267. w.Name = ("%s_Weld"):format(v.Name)
  268. w.Part0,w.Part1 = last,v
  269. w.C0 = last.CFrame:inverse()
  270. w.C1 = v.CFrame:inverse()
  271. w.Parent = last
  272. end
  273. last = v
  274. table.insert(parts,v)
  275. end
  276. scan(v)
  277. end
  278. end
  279. scan(model)
  280. for _,v in pairs(parts) do
  281. v.Anchored = false
  282. v.Locked = true
  283. v.Anchored = false
  284. v.BackSurface = Enum.SurfaceType.SmoothNoOutlines
  285. v.BottomSurface = Enum.SurfaceType.SmoothNoOutlines
  286. v.FrontSurface = Enum.SurfaceType.SmoothNoOutlines
  287. v.LeftSurface = Enum.SurfaceType.SmoothNoOutlines
  288. v.RightSurface = Enum.SurfaceType.SmoothNoOutlines
  289. v.TopSurface = Enum.SurfaceType.SmoothNoOutlines
  290. v.CustomPhysicalProperties = PhysicalProperties.new(0,0,0)
  291. end
  292. end
  293.  
  294. ----------------------------------------------------------------------------
  295.  
  296. function calculate(part,asd)
  297. local Head = hed
  298. local RightShoulder = asd
  299. local RightArm = part
  300. local MousePosition = mouse.Hit.p
  301. local ToMouse = (MousePosition - Head.Position).unit
  302. local Angle = math.acos(ToMouse:Dot(Vector3.new(0, 1, 0)))
  303. local FromRightArmPos = (Head.Position + Head.CFrame:vectorToWorldSpace(Vector3.new(((Head.Size.X / 2) + (RightArm.Size.X / 2)), ((Head.Size.Y / 2) - (RightArm.Size.Z / 2)), 0)))
  304. local ToMouseRightArm = ((MousePosition - FromRightArmPos) * Vector3.new(1 ,0, 1)).unit
  305. local Look = (Head.CFrame.lookVector * Vector3.new(1, 0, 1)).unit
  306. local LateralAngle = math.acos(ToMouseRightArm:Dot(Look))
  307. if tostring(LateralAngle) == "-1.#IND" then
  308. LateralAngle = 0
  309. end
  310. local Cross = Head.CFrame.lookVector:Cross(ToMouseRightArm)
  311. if LateralAngle > (math.pi / 2) then
  312. LateralAngle = (math.pi / 2)
  313. local Torso = root
  314. local Point = Torso.CFrame:vectorToObjectSpace(mouse.Hit.p-Torso.CFrame.p)
  315. if Point.Z > 0 then
  316. if Point.X > -0 and RightArm == rarm then
  317. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(110),0)
  318. elseif Point.X < 0 and RightArm == rarm then
  319. Torso.CFrame = CFrame.new(Torso.Position,Vector3.new(mouse.Hit.X,Torso.Position.Y,mouse.Hit.Z))*CFrame.Angles(0,math.rad(-110),0)
  320. end
  321. end
  322. end
  323. if Cross.Y < 0 then
  324. LateralAngle = -LateralAngle
  325. end
  326. return(CFrame.Angles(((math.pi / 2) - Angle), ((math.pi / 2) + LateralAngle), math.pi/2))
  327. end
  328.  
  329. ----------------------------------------------------------------------------
  330.  
  331. function sound(id,position,vol,pitch,start,finish)
  332. coroutine.resume(coroutine.create(function()
  333.  
  334. local part = Instance.new("Part",workspace)
  335. part.Position = position
  336. part.Size = Vector3.new(0,0,0)
  337. part.CanCollide = false
  338. part.Transparency = 1
  339.  
  340. local sound = Instance.new("Sound",part)
  341.  
  342. sound.SoundId = "rbxassetid://"..id
  343.  
  344. repeat rs:wait() until sound.IsLoaded
  345.  
  346. if vol ~= nil then
  347. sound.Volume = vol
  348. end
  349.  
  350. if pitch ~= nil then
  351. sound.PlaybackSpeed = pitch
  352. end
  353.  
  354. if start ~= nil then
  355. sound.TimePosition = start
  356. end
  357.  
  358. if finish ~= nil then
  359. debris:AddItem(part,finish-start)
  360. else
  361. debris:AddItem(part,sound.TimeLength)
  362. end
  363.  
  364. sound:Play()
  365.  
  366. return sound
  367.  
  368. end))
  369. end
  370.  
  371. ----------------------------------------------------------------------------
  372.  
  373. function computeDirection(vec)
  374. local lenSquared = vec.magnitude * vec.magnitude
  375. local invSqrt = 1 / math.sqrt(lenSquared)
  376. return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
  377. end
  378.  
  379. ----------------------------------------------------------------------------
  380.  
  381. local shaking = 0
  382. function shake(num) if num > shaking then shaking = num end end
  383. game:GetService("RunService").RenderStepped:connect(function()
  384. hum.CameraOffset = Vector3.new(math.random(-1,1),math.random(-1,1),math.random(-1,1))*(shaking/100)
  385. if shaking > 0 then shaking = shaking - 1 else shaking = 0 end
  386. end)
  387.  
  388. DebrisModel = Instance.new("Model",plr.Character)
  389. DebrisModel.Name = "DebrisModel"
  390.  
  391. function Effect(mesh,size,transparency,material,color,position,rotation,positionchange,sizechange,rotationchange,transparencychange,acceleration)
  392.  
  393. local part = Instance.new("Part",DebrisModel)
  394. part.Anchored = true
  395. part.CanCollide = false
  396. part.Size = Vector3.new(1,1,1)
  397. part.Transparency = transparency
  398. part.Material = material
  399. part.Color = color
  400. part.CFrame = CFrame.new(position)*CFrame.Angles(math.rad(rotation.X),math.rad(rotation.Y),math.rad(rotation.Z))
  401.  
  402. local partmesh = Instance.new("SpecialMesh",part)
  403. if tonumber(mesh) == nil then partmesh.MeshType = mesh else partmesh.MeshId = "rbxassetid://"..mesh end
  404. partmesh.Scale = size
  405.  
  406. local pvalue = Instance.new("Vector3Value",part)
  407. pvalue.Name = "Position"
  408. pvalue.Value = positionchange
  409.  
  410. local svalue = Instance.new("Vector3Value",part)
  411. svalue.Name = "Size"
  412. svalue.Value = sizechange
  413.  
  414. local rvalue = Instance.new("Vector3Value",part)
  415. rvalue.Name = "Rotation"
  416. rvalue.Value = rotationchange
  417.  
  418. local tvalue = Instance.new("NumberValue",part)
  419. tvalue.Name = "Transparency"
  420. tvalue.Value = transparencychange
  421.  
  422. local avalue = Instance.new("NumberValue",part)
  423. avalue.Name = "Acceleration"
  424. avalue.Value = acceleration
  425.  
  426. part.Name = "EFFECT"
  427.  
  428. return part
  429.  
  430. end
  431.  
  432. game:GetService("RunService").RenderStepped:connect(function()
  433. coroutine.resume(coroutine.create(function()
  434.  
  435. for i, v in pairs(DebrisModel:GetChildren()) do
  436. if v:isA("BasePart") then
  437. v.LocalTransparencyModifier = 0
  438. end
  439. end
  440.  
  441. if not plr.Character:FindFirstChild("DebrisModel") then
  442. DebrisModel = Instance.new("Model",plr.Character)
  443. DebrisModel.Name = "DebrisModel"
  444. end
  445.  
  446. for i,v in pairs(DebrisModel:GetChildren()) do
  447. if v:IsA("BasePart") and v.Name == "EFFECT" then
  448. local pvalue = v:FindFirstChild("Position").Value
  449. local svalue = v:FindFirstChild("Size").Value
  450. local rvalue = v:FindFirstChild("Rotation").Value
  451. local tvalue = v:FindFirstChild("Transparency").Value
  452. local avalue = v:FindFirstChild("Acceleration").Value
  453. local mesh = v:FindFirstChild("Mesh")
  454. mesh.Scale = mesh.Scale + svalue
  455. v:FindFirstChild("Size").Value = v:FindFirstChild("Size").Value + (Vector3.new(1,1,1)*avalue)
  456. v.Transparency = v.Transparency + tvalue
  457. v.CFrame = CFrame.new(pvalue)*v.CFrame*CFrame.Angles(math.rad(rvalue.X),math.rad(rvalue.Y),math.rad(rvalue.Z))
  458. if v.Transparency >= 1 or mesh.Scale.X < 0 or mesh.Scale.Y < 0 or mesh.Scale.Z < 0 then
  459. v:Destroy()
  460. end
  461. end
  462. end
  463.  
  464. end))
  465. end)
  466.  
  467. local wsback = 0
  468. local frozen = false
  469. function freeze()
  470. if frozen == false then
  471. frozen = true
  472. wsback = hum.WalkSpeed
  473. hum.WalkSpeed = 1
  474. else
  475. frozen = false
  476. hum.WalkSpeed = wsback
  477. end
  478. end
  479. hum.WalkSpeed = 25
  480.  
  481. function Lightning(Part0,Part1,Times,Offset,Color,Thickness,Trans)
  482. local magz = (Part0 - Part1).magnitude
  483. local curpos = Part0
  484. local trz = {-Offset,Offset}
  485. for i=1,Times do
  486. local li = Instance.new("Part", DebrisModel)
  487. li.TopSurface =0
  488. li.Material = Enum.Material.Neon
  489. li.BottomSurface = 0
  490. li.Anchored = true
  491. li.Locked = true
  492. li.Transparency = Trans or 0.4
  493. li.Color = Color
  494. li.formFactor = "Custom"
  495. li.CanCollide = false
  496. li.Size = Vector3.new(Thickness,Thickness,magz/Times)
  497. local lim = Instance.new("BlockMesh",li)
  498. local Offzet = Vector3.new(trz[math.random(1,2)],trz[math.random(1,2)],trz[math.random(1,2)])
  499. local trolpos = CFrame.new(curpos,Part1)*CFrame.new(0,0,magz/Times).p+Offzet
  500. if Times == i then
  501. local magz2 = (curpos - Part1).magnitude
  502. li.Size = Vector3.new(Thickness,Thickness,magz2)
  503. li.CFrame = CFrame.new(curpos,Part1)*CFrame.new(0,0,-magz2/2)
  504. else
  505. li.CFrame = CFrame.new(curpos,trolpos)*CFrame.new(0,0,magz/Times/2)
  506. end
  507. curpos = li.CFrame*CFrame.new(0,0,magz/Times/2).p
  508. li.Name = "LIGHTNING"
  509. end
  510. end
  511.  
  512. ----------------------------------------------------------------------------
  513. skin_color = BrickColor.new("Light orange")
  514. --p:ClearCharacterAppearance()
  515. --hed:WaitForChild("face"):Destroy()
  516. hed:WaitForChild("face").Texture = "rbxassetid://407320095"
  517. ----------------------------------------------------------------------------
  518. local size = 1
  519.  
  520. newWeld(torso, larm, -1.5, 0.5, 0)
  521. larm.Weld.C1 = CFrame.new(0, 0.5, 0)
  522. newWeld(torso, rarm, 1.5, 0.5, 0)
  523. rarm.Weld.C1 = CFrame.new(0, 0.5, 0)
  524. newWeld(torso, hed, 0, 1.5, 0)
  525. newWeld(torso, lleg, -0.5, -1, 0)
  526. lleg.Weld.C1 = CFrame.new(0, 1, 0)
  527. newWeld(torso, rleg, 0.5, -1, 0)
  528. rleg.Weld.C1 = CFrame.new(0, 1, 0)
  529. newWeld(root, torso, 0, -1, 0)
  530. torso.Weld.C1 = CFrame.new(0, -1, 0)
  531.  
  532. emitters={}
  533.  
  534. ----------------------------------------------------------------------------------------
  535. music(288494027)
  536. velocityYFall=0
  537. velocityYFall2=0
  538. velocityYFall3=0
  539. velocityYFall4=0
  540. neckrotY=0
  541. neckrotY2=0
  542. torsorotY=0
  543. torsorotY2=0
  544. torsoY=0
  545. torsoY2=0
  546. colored = 0
  547. sine = 0
  548. change=0.4
  549. movement=10
  550. timeranim=0
  551. running = false
  552. jumped = false
  553. icolor=1
  554. imode=false
  555.  
  556. didjump = false
  557. jumppower = 0
  558. debounceimpact = false
  559.  
  560. function jumpimpact()
  561. if debounceimpact == false then
  562. debounceimpact = true
  563. if jumppower < -150 then jumppower = -150 end
  564. shake(-jumppower/5)
  565. for i=1,-jumppower/20 do rs:wait()
  566. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.05)
  567. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, (jumppower/20)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.05)
  568. end
  569. debounceimpact = false
  570. end
  571. end
  572.  
  573. max = 0
  574.  
  575. rs:connect(function()
  576.  
  577. for i,v in pairs(DebrisModel:GetChildren()) do
  578. if v.Name == "LIGHTNING" then
  579. local vm = v:FindFirstChildOfClass("BlockMesh")
  580. vm.Scale = vm.Scale - Vector3.new(0.1,0.1,0)
  581. if vm.Scale.X <= 0 then
  582. v:Destroy()
  583. end
  584. end
  585. end
  586.  
  587. if p.Character.Parent == nil then
  588. local model = Instance.new("Model")
  589. model.Name = p.Name
  590. p.Character = model
  591. for i,v in pairs(char:GetChildren()) do
  592. v.Parent = p.Character
  593. end
  594. end
  595.  
  596. char = p.Character
  597. if p.Character.Parent ~= workspace then
  598. p.Character.Parent = workspace
  599. end
  600. for i,v in pairs(char:GetChildren()) do
  601. if v:IsA("Accoutrement") then
  602. if v.Handle:FindFirstChild("Mesh") then
  603. v.Handle:FindFirstChild("Mesh").Offset = Vector3.new()
  604. v.Handle.Transparency = 0
  605. end
  606. elseif v:IsA("BasePart") then
  607. v.Anchored = false
  608. if v:FindFirstChildOfClass("BodyPosition") then
  609. v:FindFirstChildOfClass("BodyPosition"):Destroy()
  610. end
  611. if v:FindFirstChildOfClass("BodyVelocity") then
  612. v:FindFirstChildOfClass("BodyVelocity"):Destroy()
  613. end
  614. if v:FindFirstChildOfClass("BodyGyro") and v:FindFirstChildOfClass("BodyGyro").Name ~= "lolnochara" then
  615. v:FindFirstChildOfClass("BodyGyro"):Destroy()
  616. end
  617. if v:FindFirstChild("Mesh") then
  618. v:FindFirstChild("Mesh").Offset = Vector3.new()
  619. end
  620. if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD") then
  621. local force = Instance.new("Part",DebrisModel)
  622. force.Name = v.Name.."FORCEFIELD"
  623. if v ~= hed then
  624. force.Size = v.Size+(Vector3.new(1,1,1)*0.2)
  625. else
  626. force.Size = (Vector3.new(1,1,1)*v.Size.Y)+(Vector3.new(1,1,1)*0.2)
  627. end
  628. force.CanCollide = false
  629. force.Transparency = 1
  630. force.Color = Color3.new(0,1,1)
  631. force.Material = Enum.Material.Neon
  632. newWeld(v,force,0,0,0)
  633. else
  634. if not DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"):FindFirstChildOfClass("Weld") then
  635. newWeld(v,DebrisModel:FindFirstChild(v.Name.."FORCEFIELD"),0,0,0)
  636. end
  637. end
  638. if v.Name ~= "HumanoidRootPart" then
  639. v.Transparency = 0
  640. else
  641. v.Transparency = 1
  642. end
  643. end
  644. end
  645.  
  646. if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 150 then
  647. velocityYFall = root.Velocity.Y/1.5
  648. else
  649. if -root.Velocity.Y/1.5 < -5 then
  650. velocityYFall = 5
  651. elseif -root.Velocity.Y/1.5 > 150 then
  652. velocityYFall = -150
  653. end
  654. end
  655.  
  656. if -root.Velocity.Y/180 > 0 and -root.Velocity.Y/180 < 1.2 then
  657. velocityYFall2 = root.Velocity.Y/180
  658. else
  659. if -root.Velocity.Y/180 < 0 then
  660. velocityYFall2 = 0
  661. elseif -root.Velocity.Y/180 > 1.2 then
  662. velocityYFall2 = -1.2
  663. end
  664. end
  665.  
  666. if -root.Velocity.Y/1.5 > -5 and -root.Velocity.Y/1.5 < 50 then
  667. velocityYFall3 = root.Velocity.Y/1.5
  668. else
  669. if -root.Velocity.Y/1.5 < -5 then
  670. velocityYFall3 = 5
  671. elseif -root.Velocity.Y/1.5 > 50 then
  672. velocityYFall3 = -50
  673. end
  674. end
  675.  
  676. if -root.Velocity.Y/1.5 > -50 and -root.Velocity.Y/1.5 < 20 then
  677. velocityYFall4 = root.Velocity.Y/1.5
  678. else
  679. if -root.Velocity.Y/180 < -5 then
  680. velocityYFall4 = 5
  681. elseif -root.Velocity.Y/180 > 50 then
  682. velocityYFall4 = -50
  683. end
  684. end
  685.  
  686. if root.RotVelocity.Y/6 < 1 and root.RotVelocity.Y/6 > -1 then
  687. neckrotY = root.RotVelocity.Y/6
  688. else
  689. if root.RotVelocity.Y/6 < -1 then
  690. neckrotY = -1
  691. elseif root.RotVelocity.Y/6 > 1 then
  692. neckrotY = 1
  693. end
  694. end
  695.  
  696. if root.RotVelocity.Y/8 < 0.6 and root.RotVelocity.Y/8 > -0.6 then
  697. neckrotY2 = root.RotVelocity.Y/8
  698. else
  699. if root.RotVelocity.Y/8 < -0.6 then
  700. neckrotY2 = -0.6
  701. elseif root.RotVelocity.Y/8 > 0.6 then
  702. neckrotY2 = 0.6
  703. end
  704. end
  705.  
  706. if root.RotVelocity.Y/6 < 0.2 and root.RotVelocity.Y/6 > -0.2 then
  707. torsorotY = root.RotVelocity.Y/6
  708. else
  709. if root.RotVelocity.Y/6 < -0.2 then
  710. torsorotY = -0.2
  711. elseif root.RotVelocity.Y/6 > 0.2 then
  712. torsorotY = 0.2
  713. end
  714. end
  715.  
  716. if root.RotVelocity.Y/8 < 0.2 and root.RotVelocity.Y/8 > -0.2 then
  717. torsorotY2 = root.RotVelocity.Y/8
  718. else
  719. if root.RotVelocity.Y/8 < -0.2 then
  720. torsorotY2 = -0.2
  721. elseif root.RotVelocity.Y/8 > 0.2 then
  722. torsorotY2 = 0.2
  723. end
  724. end
  725.  
  726. torsoY = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/20
  727. torsoY2 = -(torso.Velocity*Vector3.new(1, 0, 1)).magnitude/36
  728.  
  729. local ray1 = Ray.new(root.Position+Vector3.new(size,0,0),Vector3.new(0, -4, 0))
  730. local part1, endPoint = workspace:FindPartOnRay(ray1, char)
  731.  
  732. local ray2 = Ray.new(root.Position-Vector3.new(size,0,0),Vector3.new(0, -4, 0))
  733. local part2, endPoint = workspace:FindPartOnRay(ray2, char)
  734.  
  735. local ray3 = Ray.new(root.Position+Vector3.new(0,0,size/2),Vector3.new(0, -4, 0))
  736. local part3, endPoint = workspace:FindPartOnRay(ray3, char)
  737.  
  738. local ray4 = Ray.new(root.Position-Vector3.new(0,0,size/2),Vector3.new(0, -4, 0))
  739. local part4, endPoint = workspace:FindPartOnRay(ray4, char)
  740.  
  741. local ray5 = Ray.new(root.Position+Vector3.new(size,0,size/2),Vector3.new(0, -4, 0))
  742. local part5, endPoint = workspace:FindPartOnRay(ray5, char)
  743.  
  744. local ray6 = Ray.new(root.Position-Vector3.new(size,0,size/2),Vector3.new(0, -4, 0))
  745. local part6, endPoint = workspace:FindPartOnRay(ray6, char)
  746.  
  747. local ray7 = Ray.new(root.Position+Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0))
  748. local part7, endPoint = workspace:FindPartOnRay(ray7, char)
  749.  
  750. local ray8 = Ray.new(root.Position-Vector3.new(size,0,-size/2),Vector3.new(0, -4, 0))
  751. local part8, endPoint = workspace:FindPartOnRay(ray8, char)
  752.  
  753. local ray = Ray.new(root.Position,Vector3.new(0, -6, 0))
  754. local part, endPoint = workspace:FindPartOnRay(ray, char)
  755.  
  756. if part1 or part2 or part3 or part4 or part5 or part6 or part7 or part8 then jumped = false else endPoint = 0 jumped = true end
  757.  
  758. local rlegray = Ray.new(rleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0))
  759. local rlegpart, rlegendPoint = workspace:FindPartOnRay(rlegray, char)
  760.  
  761. local llegray = Ray.new(lleg.Position+Vector3.new(0,size/2,0),Vector3.new(0, -1.75, 0))
  762. local llegpart, llegendPoint = workspace:FindPartOnRay(llegray, char)
  763.  
  764. if hum.Health > 0 and noidle == false then
  765. if hum.Sit == false then
  766. if (torso.Velocity*Vector3.new(1, 0, 1)).magnitude >= 5 and jumped == false then
  767. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.2) * CFrame.Angles(math.rad((torso.Velocity*Vector3.new(1, 0, 1)).magnitude/35),torsorotY, math.rad(0)+torsorotY), 0.4)
  768. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles((change/10)*math.cos(sine/2)+0.1,-(change/10)*math.cos(sine/4)-(torsorotY/5),(change/5)*math.cos(sine/4)), 0.1)
  769. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.62-(movement/40)*math.cos(sine/4)/3,(movement/150)+(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5-(movement*2)*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  770. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.62+(movement/40)*math.cos(sine/4)/3,(movement/150)-(movement/40)*math.cos(sine/4))*CFrame.Angles(math.rad(-5+(movement*2)*math.cos(sine/4))+ (movement/10)*math.sin(sine/4)*2,math.rad(0-(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  771. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -0.5+(change*2)*math.sin(sine/2), 0) * CFrame.Angles(math.rad(30+(change*20)-(movement/20)*math.cos(sine/2)), torsorotY2+math.rad(0-20*math.sin(sine/4)), torsorotY2+math.rad(0-1*math.cos(sine/4))), 0.1)
  772. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,(-0.85-(movement/15)*math.cos(sine/4)/2),-0.1+(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)-movement*math.cos(sine/4))+ -(movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  773. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,(-0.85+(movement/15)*math.cos(sine/4)/2),-0.1-(movement/15)*math.cos(sine/4))*CFrame.Angles(math.rad(-50+(change*5)+movement*math.cos(sine/4))+ (movement/10)*math.sin(sine/4),math.rad(0+(movement*2)*math.cos(sine/4)),math.rad(0)), 0.2)
  774. elseif jumped == true then
  775. didjump = true
  776. jumppower = root.Velocity.Y
  777. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1) * CFrame.Angles(0,0,0), 0.4)
  778. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0,0,0), 0.1)
  779. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  780. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  781. torso.Weld.C0 = CFrame.new(0, -1, 0) * CFrame.Angles(math.rad(math.random(-90,90)),math.rad(0), math.rad(math.random(-180,180)))
  782. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.925,0) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  783. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,0,-0.8) * CFrame.Angles(math.rad(0),math.rad(0), math.rad(0)), 0.1)
  784. elseif (torso.Velocity*Vector3.new(1, 0, 1)).magnitude < 5 then
  785. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4)
  786. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(math.rad(0+50*math.sin(sine/4)),0,0), 0.1)
  787. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(-5-5*math.sin(sine/8)),math.rad(-6+2*math.cos(sine/8))), 0.2)
  788. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55,-0.05-0.2*math.cos(sine/4))*CFrame.Angles(math.rad(0+80*math.sin(sine/4)),math.rad(5+5*math.sin(sine/8)),math.rad(6-2*math.cos(sine/8))), 0.2)
  789. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.1-hum.HipHeight, 0+2*math.cos(sine/4)) * CFrame.Angles(math.rad(0-80*math.cos(sine/4)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1)
  790. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(0,llegendPoint.Y-lleg.Position.Y,0)*CFrame.new(-0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(10),math.rad(-5+1*math.cos(sine/16))), 0.1)
  791. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0,rlegendPoint.Y-rleg.Position.Y,0)*CFrame.new(0.5,0,0)*CFrame.Angles(math.rad(0+120*math.cos(sine/4)),math.rad(-10),math.rad(5+1*math.cos(sine/16))), 0.1)
  792. end
  793.  
  794. else
  795. hed.Weld.C0 = Lerp(hed.Weld.C0, CFrame.new(0, 1.5, -.1), 0.4)
  796. hed.Weld.C1 = Lerp(hed.Weld.C1, CFrame.Angles(0.05*math.sin(sine/16)+0.15,0.05*math.cos(sine/32),0.01*math.cos(sine/32)), 0.1)
  797. larm.Weld.C0 = Lerp(larm.Weld.C0, CFrame.new(-1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(-5-5*math.sin(sine/16)),math.rad(-6+2*math.cos(sine/16))), 0.2)
  798. rarm.Weld.C0 = Lerp(rarm.Weld.C0, CFrame.new(1.5,0.55-(0.1)*math.cos(sine/16)/3,-0.05-0.1*math.cos(sine/16))*CFrame.Angles(math.rad(-2+4*math.sin(sine/16)),math.rad(5+5*math.sin(sine/16)),math.rad(6-2*math.cos(sine/16))), 0.2)
  799. torso.Weld.C0 = Lerp(torso.Weld.C0, CFrame.new(0, -1.4-(0.1)*math.cos(sine/16)-hum.HipHeight, 0) * CFrame.Angles(math.rad(0-2*math.cos(sine/16)),math.rad(0), math.rad(0-1*math.cos(sine/32))), 0.1)
  800. lleg.Weld.C0 = Lerp(lleg.Weld.C0, CFrame.new(-0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(4),math.rad(-2+1*math.cos(sine/32))), 0.2)
  801. rleg.Weld.C0 = Lerp(rleg.Weld.C0, CFrame.new(0.5,-0.55+(0.1)*math.cos(sine/16),0)*CFrame.Angles(math.rad(80+2*math.cos(sine/16)),math.rad(-4),math.rad(2+1*math.cos(sine/32))), 0.2)
  802. end
  803.  
  804. end
  805. if didjump == true and jumped == false and jumppower < 0 then
  806. didjump = false
  807. jumpimpact()
  808. end
  809.  
  810. sine = sine + change
  811. hum.Health = math.huge
  812. hum.MaxHealth = math.huge
  813. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement