Advertisement
AsukaOS

Fe Booty Offender V2

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